[Omaha.pm] Catalyst: uri_with()

Jay Hannah jay at jays.net
Mon Jan 21 09:50:05 PST 2008


uri_with() is cool. it returns the URI for the page you're currently  
on, plus an arbitrary list of parameter overrides.

So to kick out a hyperlink to send the user to the current page, only  
in French (instead of English), you throw this in your Template  
Toolkit .tt file:

<a href="${Catalyst.req.uri_with(lang_code => "fr")}"><b>$ 
{Catalyst.lang('french')}</b></a>

lang() is a method we added to Catalyst to hit our home-brew  
localization database. It kicks out the word "French" in whatever  
language you're currently in...  :)

j




More information about the Omaha-pm mailing list