| CatalystX-Controller-Sugar-ActionPack documentation | view source | Contained in the CatalystX-Controller-Sugar-ActionPack distribution. |
CatalystX::Controller::Sugar::ActionPack::Default
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"]).
CatalystX::Controller::Sugar::ActionPack::Error or an /error action.
<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
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.
| CatalystX-Controller-Sugar-ActionPack documentation | view source | Contained in the CatalystX-Controller-Sugar-ActionPack distribution. |