本文整理汇总了PHP中backend\models\User::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP User::getName方法的具体用法?PHP User::getName怎么用?PHP User::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类backend\models\User
的用法示例。
在下文中一共展示了User::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="page-title">
<div class="pull-left">
<h1 class="title">查看广告位 <?php
echo $model->name;
?>
</h1>
</div>
<div class="pull-right hidden-xs">
<?php
echo Html::a('创建', ['create', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?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']]);
?>
</div>
</div>
<div class="adver-view content-body">
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'name', 'remark', ['label' => '创建者', 'value' => User::getName($model->create_uid)], 'create_at:datetime', 'update_at:datetime']]);
?>
</div>
示例2: array
use yii\helpers\Html;
use yii\widgets\DetailView;
use backend\models\User;
/* @var $this yii\web\View */
/* @var $model backend\models\Ad */
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => '广告列表', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="ad-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', 'pid', 'title', ['attribute' => 'img', 'format' => 'raw', 'value' => html::img('/' . $model->img, array('width' => 200))], 'link', 'orderid', ['attribute' => 'is_show', 'format' => 'raw', 'value' => $model->is_show == 1 ? '显示' : '不显示'], ['label' => '创建者', 'value' => User::getName($model->create_uid)], 'create_at:datetime', 'update_at:datetime']]);
?>
</div>
示例3: function
<h1 class="title"><?php
echo Html::encode($this->title);
?>
</h1>
</div>
<div class="pull-right hidden-xs">
<?php
echo Html::a('创建', ['create'], ['class' => 'btn btn-primary pull-right']);
?>
</div>
</div>
<div class="adver-index content-body">
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<?php
Pjax::begin(['formSelector' => 'form', 'enablePushState' => false]);
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'name', ['label' => '创建者', 'format' => 'raw', 'value' => function ($model) {
return User::getName($model->create_uid);
}], 'create_at:datetime', ['class' => 'yii\\grid\\ActionColumn']]]);
Pjax::end();
?>
</div>