Exemple #1
0
 public function beforeSave($insert)
 {
     $this->url = StringHelper::getTransliterateUrl($this->title);
     return parent::beforeSave($insert);
 }
 public function up()
 {
     foreach ($this->data as $item) {
         $this->insert('category', ['title' => $item[0], 'url' => \common\components\StringHelper::getTransliterateUrl($item[0]), 'icon' => $item[1], 'icon_hover' => \yii\helpers\ArrayHelper::getValue($item, '4'), 'parent_id' => \yii\helpers\ArrayHelper::getValue($item, '2'), 'image' => \yii\helpers\ArrayHelper::getValue($item, '3')]);
     }
 }