CatalystX::Controller::Sugar::ActionPack::Default - CatalystX::Controller::Sugar::ActionPack::Default documentation


CatalystX-Controller-Sugar-ActionPack documentation  | view source Contained in the CatalystX-Controller-Sugar-ActionPack distribution.

Index


NAME

Top

CatalystX::Controller::Sugar::ActionPack::Default

DESCRIPTION

Top

This module acts as a default handler for a controller. It will either server a file by its best knowledge or do go('/error', ["not_found"]).

DEPENDENCIES

Top

CatalystX::Controller::Sugar::ActionPack::Error or an /error action.

SAMPLE CONFIG FILE

Top

 <Controller::Foo>
   serve_static robots.txt
   serve_static foo/bar.png
 </Controller::Foo>

The example above requires this module to be injected into the Root controller.

It will allow the default action to serve files relative to the root/ folder. "robots.txt" will therefor be translated to:

 /path/to/my-project/root/robots.txt

ACTIONS

Top

Endpoint /*

 go '/', [@path];

Will serve a static file by these rules:

 1) Exists root/@path.tt
 2) Exists root/@path/default.tt
 3) Is the requested file defined in config file

Will go() to /error unless the rules match the request.

LICENSE

Top

AUTHOR

Top

See CatalystX::Controller::Sugar::ActionPack.


CatalystX-Controller-Sugar-ActionPack documentation  | view source Contained in the CatalystX-Controller-Sugar-ActionPack distribution.