[Catalyst] Branding - or path prefix

Matt S Trout catalyst at trout.me.uk
Sun Jul 31 16:28:35 CEST 2005


On Sun, Jul 31, 2005 at 03:28:53PM +0200, Zbyszek Lukasiak wrote:
> On Sat, Jul 30, 2005 at 09:07:05AM -0700, Bill Moseley wrote:
> ... 
> >     http://localhost/some/path/to/action
> > 
> > and instead prefix with "blue":
> > 
> >     http://localhost/blue/some/path/to/action
> > 
> I have the same need with localization - I need the controller (or the
> template) to know the language.  Currently I just check the path with
> some regexp - but I feel that there should be some more elegant
> solution.

If you're using Apache, I think I'd do this with

<Location /en>
  PerlSetVar LANGUAGE en
  ...
</Location>

and pull it out the env. var. in the application code.

-- 
     Matt S Trout           Website: http://www.shadowcatsystems.co.uk
  Technical Director        E-mail:  mst (at) shadowcatsystems.co.uk
Shadowcat Systems Ltd.



More information about the Catalyst mailing list