'sort' => [
'attributes' => [
'id',
'program_name' => [
'asc' => ['program.name' => SORT_ASC, 'sector.name' => SORT_ASC, ],
'desc' => ['program.name' => SORT_DESC, 'sector.name' => SORT_DESC,],
'default' => SORT_ASC,
],
],
]
Выбивает ошибку Call to a member function offset() on array
$records = [1, 2, 3, 4, 5];
$arrayDataProvider = new ArrayDataProvider();
$arrayDataProvider->setModels($records);
$posts = $arrayDataProvider->getModels(); // depends on items per page
$pages = $arrayDataProvider->getPagination();
User::find()->active()->haveSale()->bornToday()->all();
Yii::$app->user->isGuest ? '':
[
'label' => 'Партнёрам',
'url' => ['/partner/index'],
'options' => ['class' => 'menu-item']
],
[
'label' => 'Партнёрам',
'url' => ['/partner/index'],
'options' => ['class' => 'menu-item'],
'visible' => !Yii::$app->user->isGuest
],
$this->registerJs(
'$("document").ready(function(){
$("#new_country").on("pjax:end", function() {
$.pjax.reload({container:"#countries"}); //Reload GridView
});
});'
);
$eventMain->type = [1, 2, 5];
// а потом уже
...............
echo $form->field($eventMain,'type',[
'template' => "<label for=''>Выберите тип</label>
$chechBoxexForTypeFilter
<div>{input}</div>",
'options' => ['class' => 'class-radioCheckBox']
])
....................