[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] Catalyst: uri_with()



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