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 ('
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) 2015 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.