[Catalyst] Loading template according to request path

Alejandro Imass alejandro.imass at gmail.com
Tue Aug 11 21:51:17 GMT 2009


very cool!, live and learn, thanks!!

On Tue, Aug 11, 2009 at 4:59 PM, J. Shirley<jshirley at gmail.com> wrote:
> 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 ) = @_;
>>
>>  my $uri = URI->new($c->req->base);
>>
>> # get whatever you want from the URI
>>  my $auth = $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
>
> _______________________________________________
> List: Catalyst at lists.scsys.co.uk
> Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
> Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
> Dev site: http://dev.catalyst.perl.org/
>
>



More information about the Catalyst mailing list