public function beforeValidate() { if (!$this->slug) { $this->slug = yupe\helpers\YText::translit($this->title); } if (!$this->lang) { $this->lang = Yii::app()->getLanguage(); } return parent::beforeValidate(); }