Eric C Blount wrote:
> What if in bootstrap.php you did something like the following
> (completely untested):
>
> if (ereg('^/eng/', $_GET["url"])) {
> $_GET["url"] = str_replace('/eng/', '', $_GET["url"]);
> $GLOBALS['lang'] = 'eng';
> }
>
> Then you could just route it normally (without the language path) and
> check for the $GLOBALS['lang'] variable in the controller.
>
> I'm sure you could come up with a more elegant solution to figuring out
> which language, like checking for a two or three letter language code.
> I'm just giving an example of bootstrap.php to show that you can take
> things out of the $_GET['url'] and set variables from there.
Thank you!!!!
The keyword was the bootstrap.php :) I use the next code in here (cake1.2)
$parts=split('/',$_GET["url"]);
$lng = array_shift($parts);
if (!in_array($lng, array('hun','eng'))) {
$lng = 'hun'; //or redirect?
}else{
$_GET["url"] = join("/", $parts);
}
Configure::write('Config.language', $lng);
--
Ámon Tamás
http://linkfelho.amon.hu
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---