Hi,
I try a solution for this:
Routes.php include this:
$Route->connect('/:language/', array('controller' => 'home', 'action'
=> 'index'));
$Route->connect('/:language/:controller/:action/*', null,null);
The first one, is to call home controller after language selection,
and show the home for this language
The second one is for "all" navigation.
Using this routes you will have a param named language, and can access
to it with this $this->params['language']
I hope this can help you.
Bye!
On 6 mayo, 01:21, "pierre.k" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I am looking for a solution to the following problem: basically, I
> want urls in form "/controller/action/params" as well as "/en/
> controller/action/params". The idea behind this is to allow for
> multiple languages ("/en/..." might as well be replaced with "/cs/..."
> and alike) and in ideal case, I would like the language identifier to
> be available as a global variable. This would allow me to use the
> variable in model (and also controller & view) classes, in the
> following fashion, for example:
>
> class Hotel extends AppModel {
> var $hasOne = array("HotelTxt" => array("conditions" =>
> "lang={lang}"));
>
> }
>
> In other words, whenever an url like "/cs/*" or "/en/*" is
> encountered, I need to store the "cs"/"en" part into a global var and
> effectively go to url "*" instead. Can this be achieved via cakephp
> routing? Or should I approach to the problem in a completely different
> manner?
>
> Thanks for your ideas,
> Petr K.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---