HostFreeController.php 987 Bytes
<?php

namespace app\controllers;

use Yii;
use app\models\Host;
use app\models\HostSearch;
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 [
            'verbs' => [
                'class' => VerbFilter::className(),
                'actions' => [
                    'delete' => ['POST'],
                ],
            ],
        ];
    }

    /**
     * Lists all Host models.
     * @return mixed
     */
    public function actionIndex()
    {
        $searchModel = new HostSearch(['wis_status' => 1]);
        $dataProvider = $searchModel->search(Yii::$app->request->queryParams);

        return $this->render('index', [
            'searchModel' => $searchModel,
            'dataProvider' => $dataProvider,
        ]);
    }


}