The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Catalyst::Engine - The Catalyst Engine

SYNOPSIS

See Catalyst.

DESCRIPTION

METHODS

$c->benchmark($coderef)

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 );
$c->comp($name)
$c->component($name)

Get a component object by name.

    $c->comp('MyApp::Model::MyModel')->do_stuff;

Regex search for a component.

    $c->comp('mymodel')->do_stuff;
$c->counter

Returns a hashref containing coderefs and execution counts. (Needed for deep recursion detection)

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

Returns an arrayref containing error messages.

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

Add a new error.

    $c->error('Something bad happened');
$c->execute($class, $coderef)

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

$c->finalize

Finalize request.

$c->finalize_output

<obsolete>, see finalize_body

$c->finalize_body

Finalize body.

$c->finalize_cookies

Finalize cookies.

$c->finalize_error

Finalize error.

$c->finalize_headers

Finalize headers.

$c->handler( $class, @arguments )

Handles the request.

$c->prepare(@arguments)

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

$c->prepare_action

Prepare action.

$c->prepare_body

Prepare message body.

$c->prepare_connection

Prepare connection.

$c->prepare_cookies

Prepare cookies.

$c->prepare_headers

Prepare headers.

$c->prepare_parameters

Prepare parameters.

$c->prepare_path

Prepare path and base.

$c->prepare_request

Prepare the engine request.

$c->prepare_uploads

Prepare uploads.

$c->run

Starts the engine.

$c->request
$c->req

Returns a Catalyst::Request object.

    my $req = $c->req;
$c->response
$c->res

Returns a Catalyst::Response object.

    my $res = $c->res;
$class->setup

Setup.

    MyApp->setup;
$class->setup_components

Setup components.

$c->state

Contains the return value of the last executed action.

$c->stash

Returns a hashref containing all your data.

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

AUTHOR

Sebastian Riedel, sri@cpan.org

COPYRIGHT

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