SluggableBehavior::class, 'attribute' => 'question_type', ] ]; } /** * {@inheritdoc} */ public function rules() { return [ [['question_type'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'question_type' => 'Тип вопроса', 'slug' => 'Slug', ]; } /** * @return \yii\db\ActiveQuery */ public function getQuestions() { return $this->hasMany(Question::className(), ['question_type_id' => 'id']); } }