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(),
]
]
];
}
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',* /
]
]
];
}
Invalid Configuration – yii\base\InvalidConfigException
Object configuration must be an array containing a "class" element.
return [
[
.....
]
]
return [
.....
]
вот так пытаюсь получить его в контролере модуляЭто модель а не контролер
public function behaviors()
{
return [
'slug' => [
'class' => SluggableBehavior::className(),
'attribute' => 'title',
'slugAttribute' => 'slug'
],
'menu' => [
'class' => MenuFrontendBehavior::className(),
//'model' => 'yes',
//'prop2' => 'value2',* /
]
]
}