use yii\helpers\Html; use yii\widgets\DetailView; /* @var $this yii\web\View */ /* @var $model app\models\PopulacMapuser */ $this->title = $model->nickname . "[{$model->upmapuser}]"; $this->params['breadcrumbs'][] = ['label' => Yii::t('app', '账号管理'), 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="populac-mapuser-view"> <h1><?php echo Html::encode($this->title); ?> </h1> <p> <?php echo Html::a(Yii::t('app', '修改'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']); ?> <?php echo Html::a(Yii::t('app', '删除'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', "该操作将删除登录账号[{$model->nickname}],请谨慎操作,确定吗?"), 'method' => 'post']]); ?> </p> <?php echo DetailView::widget(['model' => $model, 'attributes' => ['mapuser', 'pass', 'rights', 'upmapuser', 'id', 'nickname', 'email:email', 'tel', ['label' => '账号状态', 'value' => \app\common\globalFunc\Func::getPreferencesName1('sstatus', $model->status)], 'auth_key', 'access_token', 'created_time', 'updated_time']]); ?> </div>
public function actionEvent() { Func::print_br('---------演示‘事件处理’-----------'); $this->on('sayHello', function ($event) { Func::print_br($event->data); }, 'Hello my friend!' . time()); $this->trigger('sayHello'); }