I'm trying to get data from DB and show it in menu.
echo NavX::widget([
'options' => ['class' => 'navbar-nav navbar-right'],
'items' => [
array_map(function ($model) {
return [
'label' => $model['param2'],
'url' => ["/users/{$model['param3']}"],
];
}, Model::find()->where(['userID' => 32])->asArray()->all()),
],
]);
But unfortunately this code is wrong, error says:
Array to string conversion
Is there any other way to fix it ?