当前位置: 首页>>代码示例>>PHP>>正文


PHP User::getName方法代码示例

本文整理汇总了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>
开发者ID:s-nice,项目名称:snece,代码行数:30,代码来源:view.php

示例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>
开发者ID:s-nice,项目名称:snece,代码行数:30,代码来源:view.php

示例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>
开发者ID:s-nice,项目名称:snece,代码行数:30,代码来源:index.php


注:本文中的backend\models\User::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。