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