OX::RouteBuilder::HTTPMethod - OX::RouteBuilder which routes to a method in a controller based on the HTTP method
version 0.13
package MyApp; use OX; has controller => ( is => 'ro', isa => 'MyApp::Controller', ); router as { route '/' => 'controller'; };
This is an OX::RouteBuilder which allows to a controller class based on the HTTP method used in the request. The action_spec should be a string corresponding to a service which provides a controller instance. When a request is made for the given path, it will look in that class for a method which corresponds to the lowercased version of the HTTP method used in the request (for instance, get, post, etc). If no method is found, it will fall back to looking for a method named any. If that isn't found either, an error will be raised.
action_spec
get
post
any
action will automatically be added to the route as a default, as well as name (which will be set to the same thing as action).
action
name
Stevan Little <stevan.little@iinteractive.com>
Jesse Luehrs <doy@tozt.net>
This software is copyright (c) 2013 by Infinity Interactive.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install OX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm OX
CPAN shell
perl -MCPAN -e shell install OX
For more information on module installation, please visit the detailed CPAN module installation guide.