/** * Lists all Vacancy models. * @return mixed */ public function actionIndex() { // $searchModel = new VacancySearch(); // $dataProvider = $searchModel->search(Yii::$app->request->queryParams); $filterModel = new VacancyFilter(); $filterModel->load(Yii::$app->request->post(), 'VacancyFilter'); $dataProvider = $filterModel->dataProvider(); return $this->render('index', ['filterModel' => $filterModel, 'dataProvider' => $dataProvider]); }
<?php $form = RoleBasedActiveForm::begin(); ?> <div class="filter-form vacancy"> <?php echo $form->field($filterModel, 'durations')->checkboxlist(VacancyFilter::getDurationsList()); ?> <?php echo $form->field($filterModel, 'workTypes')->checkboxlist(VacancyFilter::getWorkTypesList()); ?> <?php echo $form->field($filterModel, 'courses')->checkboxlist(VacancyFilter::getCoursesList()); ?> <?php echo $form->field($filterModel, 'max_hours')->widget(Slider::className(), ['name' => 'max_hours', 'value' => 7, 'sliderColor' => Slider::TYPE_GREY, 'handleColor' => Slider::TYPE_DANGER, 'pluginOptions' => ['handle' => 'triangle', 'tooltip' => 'always', 'min' => 2, 'max' => 20, 'step' => 1]]); ?> <?php echo Html::submitButton('Search', ['class' => 'btn btn-primary']); ?> <style> div.slider.slider-horizontal{ #width:150px;