Trying to create my first behavior:
use backend\modules\menus\behavior\MenuFrontendBehavior; class Firmcat extends \yii\db\ActiveRecord { public function behaviors() { return [ [ [ 'class' => SluggableBehavior::className(), 'attribute' => 'title', 'slugAttribute' => 'slug' ], 'MenuFrontendBehavior' => [ 'class' => MenuFrontendBehavior::className(), ] ] ]; } So trying to get it in the module controller:
class Firmcat extends \yii\db\ActiveRecord { public function behaviors() { return [ [ [ 'class' => SluggableBehavior::className(), 'attribute' => 'title', 'slugAttribute' => 'slug' ], 'MenuFrontendBehaviors' => [ 'class' => MenuFrontendBehavior::className(), //'model' => 'yes', //'prop2' => 'value2',* / ] ] ]; } Gives an error message:
Invalid Configuration – yii\base\InvalidConfigException Object configuration must be an array containing a "class" element. What am I doing wrong?