Пример #1
0
 /**
  * Initializes the application component.
  * This method overrides the parent implementation by preprocessing
  * the user request data.
  */
 public function init()
 {
     parent::init();
     if ($this->basePath === null) {
         $this->basePath = Yii::getPathOfAlias('application.messages');
     }
 }
Пример #2
0
 /**
  * Initializes the application component.
  * This method overrides the parent implementation by preprocessing
  * the user request data.
  */
 public function init()
 {
     parent::init();
     if (($this->_db = Yii::app()->getComponent($this->connectionID)) instanceof CDbConnection) {
         $this->_db->setActive(true);
     } else {
         throw new CException(Yii::t('yii', 'CDbMessageSource.connectionID is invalid. Please make sure "{id}" refers to a valid database application component.', array('{id}' => $this->connectionID)));
     }
 }