本文整理汇总了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>