Website is working!

This commit is contained in:
vladislav.khorev committed 2014-11-22 13:14:22 +00:00
1 parent c978ba8e19
commit 2ed0710575
24 files changed
+644 -119

No files matched your search

@@ -0,0 +1,30 @@
<?php
/**
* ApplicationConfigBehavior is a behavior for the application.
* It loads additional config paramenters that cannot be statically
* written in config/main
*/
class ApplicationConfigBehavior extends CBehavior
{
/**
* Declares events and the event handler methods
* See yii documentation on behaviour
*/
public function events()
{
return array_merge(parent::events(), array(
'onBeginRequest'=>'beginRequest',
));
}
/**
* Load configuration that cannot be put in config/main
*/
public function beginRequest()
{
if (isset(Yii::app()->request->cookies['pref_lang']))
$this->owner->language= Yii::app()->request->cookies['pref_lang']->value; //set a language for each request
else
$this->owner->language='en';
}
}