getFilterData('and'); $filter[0] = 'and'; TableWidget::widget([ 'top' => [ 'title' => 'Запитвания', 'data' => [ 'index/dashboard' => 'Начало', ] ], 'filter' => [ [ 'name' => ['Име', 'c4'], 'email' => ['Ел. поща', 'c4'], ], ], 'actions' => [ 'delete' => 'Изтриване на помощна информация' ], 'th' => [ '№' => 'c0 text-right', 'Име' => 'c1', 'Ел. поща' => 'c2', 'Действие' => 'c2', 'Какво не е наред' => '', 'Дата' => 'c0' ], 'model' => Inquiries ::class, 'data' => Inquiries::find()->where(Yii::$app->getFilterData('or'))->orderBy(['date_time' => SORT_DESC])->loop([ 'id', 'name', 'email', 'operation', 'error', function (Inquiries $i) { if ($i->date_time) return '
'.date('d.m.Y H:i ч.', strtotime($i->date_time)).'
'; } ], $_GET['p'] ?? 1, 50) ]); FormWidget::widget([ 'top' => [ 'title' => '', 'title_edit' => 'Преглед запитване', 'data' => [ 'index/dashboard' => 'Начало', 'index/inquiries' => 'Запитвания', ], ], 'tabs' => $tabs ?? [], 'writeView' => "index/tabs/" . Includes::tab($tab) . "/inquiries_w", 'model' => Inquiries::class, 'validation' => function ($p) use ($tab) { return null; }, 'postService' => function ($p, Inquiries $model) use ($tab) { $model->setPostDataToModel(); $model->save(); Yii::$app->flash('success', isset($_GET['id']) ? 'Данните са записани успешно' : 'Данните са създадени успешно'); $model->smartRedirect(); } ]);