[Catalyst] help with :Path and config

John M. Dlugosz wxju46gefd at snkmail.com
Fri Apr 8 09:18:49 GMT 2011


I want to make an "admin" page available on a URL that's not called "admin", but is 
something less obvious that people might guess.  Even though it will have a password, it 
will stop people from just trying to find it.

I thought to configure it using the normal config features:

     use 5.10.1;
     use utf8;
     package LEDft::Controller::Admin;
     use Moose;
     use Method::Signatures::Simple;
     use namespace::autoclean;

     BEGIN {extends 'Catalyst::Controller'; }

     has url_name => (
         is => 'ro',
         required => 1,
     );


     method index($c) :Path($url_name) :Args(0) {    }


However, the debug screen tells me that the Loaded Path action is "/admin/$url_name".  Why 
did it take the stuff in parens as a literal string, when I didn't use any kind of quotes 
around it?  An example in the manual is
     sub bar : Path('foo/bar') { }
which shows that it is quoted normally:  not :Path(foo/bar).



More information about the Catalyst mailing list