[Catalyst] Relative links

Matt S Trout dbix-class at trout.me.uk
Thu Nov 10 02:22:00 CET 2005


On Wed, Nov 09, 2005 at 04:49:16PM -0800, Bill Moseley wrote:
> On Thu, Nov 10, 2005 at 12:33:33AM +0000, Matt S Trout wrote:
> > Bear in mind also that there's now a $c->namespace that keeps the *current
> > namespace* being executed in - so it changes on forward etc. $c->action
> > doesn't because it's the main action of the request rather than the current
> > namespace.
> 
> Not something I already knew.
> 
> So, it's not useful in a template:
> 
>     <li>Local namespace = '[% c.namespace %]'<li>
>     Local namespace = 'WS2::V::TT'

No it isn't. But [% c.action.namespace %] would be fine for that.

> But I could use it in actions that might get forwarded *to*:
> 
>     $c->stash->{cur_namespace} = $c->namespace;

Ex-actly :D

-- 
     Matt S Trout       Specialists in Perl consulting, web development, and
  Technical Director    UNIX/Linux systems architecture and automation. Mail
Shadowcat Systems Ltd.  mst (at) shadowcatsystems.co.uk for more information

 + Help us build a better perl ORM: http://dbix-class.shadowcatsystems.co.uk/ +



More information about the Catalyst mailing list