[Catalyst] help with :Path and config

Charlie Garrison garrison at zeta.org.au
Fri Apr 8 09:49:01 GMT 2011


Good evening,

On 8/04/11 at 4:18 AM -0500, John M. Dlugosz <wxju46gefd at snkmail.com> wrote:

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

I don't think variable are allowed in method attributes, maybe someone else will correct me.

>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).

And that also shows the path as a string, not a variable. 

To achieve what you want, change the config:

__PACKAGE__->config->{path} = '/secret_path';

method index($c) :Path  {    }


Charlie

-- 
   Ꮚ Charlie Garrison ♊ <garrison at zeta.org.au>
   
O< ascii ribbon campaign - stop html mail - www.asciiribbon.org
〠  http://www.ietf.org/rfc/rfc1855.txt




More information about the Catalyst mailing list