WebAPI::DBIC::Resource::Role::Router
version 0.001007
This role provides methods to interface with the router.
WebAPI::DBIC::Resource::Role::Router - interface with the router
$absolute_url = $self->uri_for( resource_class => $resource_class, # e.g. 'TestSchema::Result::Artist' 1 => $artist_id # key value (first and only in this case) ); ($prefix_path, $relative_path) = $self->uri_for(...);
Uses the router to find a url that matches the given parameter hash. Returns undef if there's no match.
The Plack request env hash is used to get the router ('plack.router') and the script url prefix ('SCRIPT_NAME').
plack.router
SCRIPT_NAME
When called in scalar context the absolute url is returned. This is the concatenation of the script url prefix and the relative path matched by the router. When called in list context the two values are returned separately.
Tim Bunce <Tim.Bunce@pobox.com>
This software is copyright (c) 2014 by Tim Bunce.
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 WebAPI::DBIC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WebAPI::DBIC
CPAN shell
perl -MCPAN -e shell install WebAPI::DBIC
For more information on module installation, please visit the detailed CPAN module installation guide.