| Current Path : /var/www/html/project/controllers/ |
| Current File : /var/www/html/project/controllers/DashboardController.php |
<?php
namespace app\controllers;
use Yii;
use yii\filters\AccessControl;
use yii\web\Controller;
use yii\filters\VerbFilter;
use app\models\ProjectsSearch;
use app\models\Projects;
class DashboardController extends Controller {
public function behaviors() {
return [
'access' => [
'class' => AccessControl::className(),
'only' => ['logout'],
'rules' => [
[
'actions' => ['logout'],
'allow' => true,
'roles' => ['@'],
],
],
],
'verbs' => [
'class' => VerbFilter::className(),
'actions' => [
'logout' => ['post'],
],
],
];
}
public function actionIndex() {
$searchModel = new ProjectsSearch();
$dataProvider = $searchModel->search2(Yii::$app->request->queryParams);
return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider,]);
}
public function actionDetails($id) {
$modelProject = Projects::findOne($id);
if (!empty($modelProject))
return $this->render('details', ['modelProject' => $modelProject,]);
}
}