Ejemplo n.º 1
0
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\Admin */
$this->title = $model->username;
$this->params['breadcrumbs'][] = ['label' => '管理员管理', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="admin-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('更新管理员', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('删除管理员', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => '确认删除吗?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'username', 'email:email', ['attribute' => 'type', 'value' => app\models\Admin::getTypeName($model->type)], 'last_login_time', 'ip_address', ['attribute' => 'group_id', 'format' => 'html', 'value' => \app\models\Admin::getGroup($model->group_id)], 'create_time', 'create_user', 'update_time', 'update_user']]);
?>

</div>