示例#1
0
<?php

use app\models\search\ProjectsSearch;
use yii\helpers\Url;
$searchModel = new ProjectsSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
?>
<h1>
	<?php 
echo Yii::t('app', 'Alle projecten');
?>
	<?php 
if (Yii::$app->user->can('createProject')) {
    ?>
		<a href="<?php 
    echo Url::toRoute('projects/form');
    ?>
" class="btn btn-success pull-right"><?php 
    echo Yii::t('app', 'Toevoegen');
    ?>
</a>
	<?php 
}
?>
</h1>
<?php 
echo $this->render('partials/dataTable.php', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 /**
  * Lists all Projects models.
  * @return mixed
  */
 public function actionIndex()
 {
     $searchModel = new ProjectsSearch();
     $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
     return $this->render('index', ['searchModel' => $searchModel, 'dataProvider' => $dataProvider]);
 }