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