當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。