[Catalyst] Loading template according to request path

J. Shirley jshirley at gmail.com
Tue Aug 11 20:59:09 GMT 2009


On Tue, Aug 11, 2009 at 1:34 PM, Alejandro Imass
<alejandro.imass at gmail.com>wrote:

> Well in Catalyst an action is usually mapped to a controller method,
> so I really don't understand your request. Maybe this example will
> help:
>
>
> sub edit : Local {
>  my ( $self, $c ) =3D @_;
>
>  my $uri =3D URI->new($c->req->base);
>
> # get whatever you want from the URI
>  my $auth =3D $uri->authority;
>
>  #do whatever you want with that info...
>
> See perldoc URI
>

$c->req->uri is a blessed URI object already, so you can just do
$c->req->uri->authority as well.

-J
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20090811/33af7=
74d/attachment.htm


More information about the Catalyst mailing list