Ejemplo n.º 1
0
 public function actionDelete($id)
 {
     $user = User::find()->id($id)->one();
     if ($user && $user->delete()) {
         return $this->redirect(['user/index']);
     }
     throw new ForbiddenHttpException('Access Denied.');
 }
Ejemplo n.º 2
0
<?php

/**
 *  _   __ __ _____ _____ ___  ____  _____
 * | | / // // ___//_  _//   ||  __||_   _|
 * | |/ // /(__  )  / / / /| || |     | |
 * |___//_//____/  /_/ /_/ |_||_|     |_|
 * @link http://vistart.name/
 * @copyright Copyright (c) 2016 vistart
 * @license http://vistart.name/license/
 */
use yii\widgets\ListView;
use yii\data\ActiveDataProvider;
use rhopress\models\User;
$dataProvider = new ActiveDataProvider(['query' => User::find(), 'pagination' => ['pageSize' => 20]]);
echo ListView::widget(['dataProvider' => $dataProvider, 'itemView' => 'index/user']);