<?php namespace app\controllers; use Yii; use app\models\Host; use app\models\HostSearch; use app\models\Filter; use yii\filters\AccessControl; use yii\web\Controller; use yii\web\NotFoundHttpException; use yii\filters\VerbFilter; /** * HostController implements the CRUD actions for Host model. */ class HostFreeController extends Controller { /** * {@inheritdoc} */ public function behaviors() { return [ 'access' => [ 'class' => AccessControl::className(), 'rules' => [ [ 'allow' => true, 'roles' => ['@'], ], ], ], 'verbs' => [ 'class' => VerbFilter::className(), 'actions' => [ 'delete' => ['POST'], ], ], ]; } /** * Lists all Host models. * @return mixed */ public function actionIndex() { $searchModel = new HostSearch(['wis_status' => Host::STATUS_WIS_FREE, 'status' => Filter::STATUS_ON]); $dataProvider = $searchModel->search(Yii::$app->request->queryParams); return $this->render('index', [ 'searchModel' => $searchModel, 'dataProvider' => $dataProvider, ]); } }