Hi I am trying to set the Session var with a language variable, then
use it to tell another controller what table to use.
I have a page controller and i am calling the before filter function
to set the default language
function beforeFilter(){
if($this->Session->check('language') || $this->Session->read
('language') == ''){
$this->Session->write('language', 'english');
}
print $this->Session->read('language');
}
the page controller use the content model then i want to use the
session variable i have just set to set the table like
<?php
class Content extends AppModel {
var $name = 'Content';
var $useTable = $this->Session->read('language');
}
?>
however this does not work, any idea how i can do this. Does the
content model get included before the beforeFilter of my page model
therefore the Session is not set?
thanks in advance for any help
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---