Catalyst::Engine - The Catalyst Engine


See Catalyst.



$c->action( $name => $coderef, ... )
$c->action( $name )

Add one or more actions.

    $c->action( '!foo' => sub { $_[1]->res->output('Foo!') } );

Get an action's class and coderef.

    my ($class, $code) = @{ $c->action('foo') };

Get a list of available actions.

    my @actions = $c->action;

It also automatically calls setup() if needed.

See Catalyst::Manual::Intro for more informations about actions.


Takes a coderef with arguments and returns elapsed time as float.

    my ( $elapsed, $status ) = $c->benchmark( sub { return 1 } );
    $c->log->info( sprintf "Processing took %f seconds", $elapsed );

Get a component object by name.


Regex search for a component.

$c->errors($error, ...)

Returns an arrayref containing errors messages.

    my @errors = @{ $c->errors };

Add a new error.

    $c->errors('Something bad happened');

Finalize request.


Finalize headers.


Finalize output.


Forward processing to a private/public action or a method from a class. If you define a class without method it will default to process().

    $c->forward(qw/MyApp::Model::CDBI::Foo do_stuff/);

Handles the request.


Turns the engine-specific request (Apache, CGI...) into a Catalyst context.


Prepare action.


Prepare connection.


Prepare cookies.


Prepare headers.


Prepare parameters.


Prepare path and base.


Prepare the engine request.


Prepare uploads.

$c->process($class, $coderef)

Process a coderef in given class and catch exceptions. Errors are available via $c->errors.


Remove an action.


Returns a Catalyst::Request object.

    my $req = $c->req;

Returns a Catalyst::Response object.

    my $res = $c->res;



Setup components.


Returns a hashref containing all your data.

    $c->stash->{foo} ||= 'yada';
    print $c->stash->{foo};


Sebastian Riedel,


This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.