本文整理匯總了PHP中backend\models\User::getUserById方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::getUserById方法的具體用法?PHP User::getUserById怎麽用?PHP User::getUserById使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類backend\models\User
的用法示例。
在下文中一共展示了User::getUserById方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
use yii\widgets\DetailView;
use backend\models\User;
use kartik\datecontrol\DateControl;
use common\models\Categoria;
/* @var $this yii\web\View */
/* @var $model common\models\Menu */
$this->title = $model->nombre;
$this->params['breadcrumbs'][] = ['label' => 'Menús', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="menu-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Actualizar', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Eliminar', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['id', ['attribute' => 'id_categoria', 'value' => Categoria::getCategoryById($model->id_categoria)], 'nombre', 'descripcion', 'precio', ['attribute' => 'create_user', 'value' => User::getUserById($model->create_user)], ['attribute' => 'create_time', 'value' => Yii::$app->formatter->asDate($model->create_time, "full")], ['attribute' => 'update_user', 'value' => User::getUserById($model->update_user)], ['attribute' => 'update_time', 'format' => ['date', 'php:l, d \\d\\e F \\d\\e\\l Y']]]]);
?>
</div>