Answer the question
In order to leave comments, you need to log in
What's wrong with seeing?
trying to create my first behavior
actually here
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.
Answer the question
In order to leave comments, you need to log in
Offhand, I can assume that you have too many arrays in nesting
return [
[
.....
]
]
return [
.....
]
Universal - no way. Of course, you can try to rely on the nav and main tags, but no one guarantees that they are used, no one guarantees that they have what you need.
No way.
Well, the menu block can still be somehow determined by the links going in it in a row. And then, it must be borne in mind that links can have multi-level wrappers, as is done in the same Yukoz in default templates.
But it’s impossible to cleanly separate the content from the same sidebars, footers, ads and other things.
It's easy, we hire a student with a small amount, we say what to do and voila
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question