NAME

RapidApp::Responder

SYNOPSIS

package MyModule; sub content { if ($error) die RapidApp::Responser::MyErrorResponder->new(\%params); return RapidApp::Responser::MyNormalResponder->new(\%params); }

DESCRIPTION

A "Responder" is much like a Catalyst::View, except it is designed to be allocated per request, and it can be thrown. This is much more convenient and less error-prone than setting view parameters, putting the view name in the stash, and forwarding to the view.

In fact, I would have naamed the class "View" if that weren't so likely to lead to confusion.

ATTRIBUTES

action

For interoperability with Catalyst, a Responder can be converted into a Catalyst::Action. This attribute will create or return a cached Action object which runs this responder.

METHODS

$responder->writeResponde($c)

This is the main processing method of Responder, much like View->process($c);

It fills in the fields of $c->response