本文整理汇总了PHP中yii\widgets\DetailView类的典型用法代码示例。如果您正苦于以下问题:PHP DetailView类的具体用法?PHP DetailView怎么用?PHP DetailView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DetailView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionModelVariables
public function actionModelVariables()
{
/** @var Config $model */
$model = $this->findModel();
$model->load(Yii::$app->request->post());
echo DetailView::widget(['model' => false, 'attributes' => $model->variables()]);
}
示例2: run
public function run()
{
$ret_val = '';
if (isset($this->header) && is_string($this->header) && !is_bool($this->header)) {
$ret_val = Html::tag('h2', $this->header);
}
switch ($this->displayAs) {
case 'grid':
$this->items = is_array($this->items) ? $this->items : [$this->items];
$this->widgetOptions = array_merge(['summary' => false, 'layout' => '{items}', 'showHeader' => $this->header, 'dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => $this->items]), 'columns' => $this->attributes], $this->widgetOptions);
$ret_val .= \kartik\grid\GridView::widget($this->widgetOptions);
break;
case 'list':
$this->widgetOptions = array_merge(['itemOptions' => ['tag' => false], 'summary' => false, 'dataProvider' => new \yii\data\ArrayDataProvider(['allModels' => $this->items]), 'itemView' => function ($model, $key, $index, $widget) {
return $this->renderListItem($model, $key, $index, $widget);
}], $this->widgetOptions);
$ret_val .= \yii\widgets\ListView::widget($this->widgetOptions);
break;
case 'csv':
$ret_val = [];
foreach ($this->items as $index => $item) {
$ret_val[] = $this->renderCsvItem($item, $index);
}
$ret_val = Html::tag('div', implode(', ', $ret_val));
break;
case 'tags':
foreach ($this->items as $index => $item) {
$ret_val .= $this->renderTagItem($item, $index);
}
$ret_val = Html::tag('div', $ret_val);
break;
default:
$this->widgetOptions['class'] = isset($this->widgetOptions['class']) ? $this->widgetOptions['class'] : 'table';
$this->widgetOptions = array_merge(['model' => $this->items, 'attributes' => $this->attributes, 'options' => ['class' => 'table']], $this->widgetOptions);
$ret_val .= \yii\widgets\DetailView::widget($this->widgetOptions);
break;
}
return $ret_val;
}
示例3:
<div class="box box-primary">
<div class="box-header">
<i class="fa fa-reply"></i>
<h3 class="box-title"><?php
echo Yii::t('writesdown', 'Reply To');
?>
</h3>
</div>
<div class="box-body">
<?php
echo $commentParent->comment_content;
?>
</div>
</div>
<?php
echo $this->render('_form-reply', ['model' => $model, 'form' => $form]);
?>
</div>
<div class="col-md-4 post-comment-update">
<?php
echo DetailView::widget(['model' => $commentParent, 'attributes' => ['id', ['attribute' => 'comment_post_id', 'value' => Html::a($commentParent->commentPost->post_title, ['/post/update', 'id' => $commentParent->commentPost->id]), 'format' => 'raw'], 'comment_author:ntext', 'comment_author_email:email', 'comment_author_url:url', ['attribute' => 'comment_author_ip', 'value' => Html::a($model->comment_author_ip, 'http://whois.arin.net/rest/ip/' . $model->comment_author_ip, ['target' => '_blank']), 'format' => 'raw'], ['attribute' => 'comment_date', 'value' => Yii::$app->formatter->asDatetime($model->comment_date, 'php:M d, Y H:i:s'), 'format' => 'raw'], 'comment_approved', 'comment_agent', ['attribute' => 'comment_parent', 'value' => $commentParent->comment_parent ? Html::a($commentParent->comment_parent, ['update', 'id' => $commentParent->comment_parent]) : '', 'format' => 'raw'], 'comment_user_id']]);
?>
</div>
</div>
<?php
ActiveForm::end();
示例4: initDefaultButtons
protected function initDefaultButtons()
{
if (!isset($this->buttons['view'])) {
$this->buttons['view'] = function ($url, $model, $key) {
Modal::begin(['id' => 'gridview_view_modal_' . $key, 'header' => '<h2>Detail</h2>']);
echo DetailView::widget(['model' => $model, 'attributes' => $this->getDataCellDetailAttributes($model, $key)]);
Modal::end();
$options = array_merge(['class' => 'btn btn-light btn-icon', 'data-toggle' => 'modal', 'data-target' => '#gridview_view_modal_' . $key, 'title' => Yii::t('yii', 'View'), 'aria-label' => Yii::t('yii', 'View'), 'data-pjax' => '0'], $this->buttonOptions);
return Html::a('<span class="glyphicon"></span>', $url, $options);
};
}
if (!isset($this->buttons['update'])) {
$this->buttons['update'] = function ($url, $model, $key) {
$options = array_merge(['class' => 'btn btn-light btn-icon', 'title' => Yii::t('yii', 'Update'), 'aria-label' => Yii::t('yii', 'Update'), 'data-pjax' => '0'], $this->buttonOptions);
return Html::a('<span class="glyphicon"></span>', $url, $options);
};
}
if (!isset($this->buttons['delete'])) {
$this->buttons['delete'] = function ($url, $model, $key) {
$options = array_merge(['class' => 'btn btn-light btn-icon', 'title' => Yii::t('yii', 'Delete'), 'aria-label' => Yii::t('yii', 'Delete'), 'data-confirm' => Yii::t('yii', 'Are you sure you want to delete this item?'), 'data-method' => 'post', 'data-pjax' => '0'], $this->buttonOptions);
return Html::a('<span class="glyphicon"></span>', $url, $options);
};
}
}
示例5:
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\TblClassroomSetup */
$this->title = 'Classroom Setup #' . $model->form_id;
$this->params['breadcrumbs'][] = ['label' => 'Settings'];
$this->params['breadcrumbs'][] = ['label' => 'Configurations', 'url' => ['/site/confg']];
$this->params['breadcrumbs'][] = ['label' => 'Classroom Setups', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="tbl-classroom-setup-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Update', ['update', 'id' => $model->form_id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Delete', ['delete', 'id' => $model->form_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' => ['form_id', 'user_id', 'form_type', 'setup_type', 'setup_other', 'closed_by', 'start_date', 'end_date', 'update_date', 'assigned_to', 'inventory', 'comments', 'classroom', 'classroom_other', 'course_code', 'setup_time', 'pickup_time', 'scheduled_start_time', 'scheduled_end_time', 'status']]);
?>
</div>
示例6:
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model frontend\models\Processo */
$this->title = $model->numeroProcesso;
$this->params['breadcrumbs'][] = ['label' => 'Processos', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="processo-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Atualizar', ['update', 'numeroProcesso' => $model->numeroProcesso, 'Usuario_matricula' => $model->Usuario_matricula, 'Audiencia_codigo' => $model->Audiencia_codigo, 'Preatendimento_idPreatendimento' => $model->Preatendimento_idPreatendimento, 'Preatendimento_Usuario_matricula' => $model->Preatendimento_Usuario_matricula, 'Preatendimento_Interessado_cpf' => $model->Preatendimento_Interessado_cpf], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Deletar', ['delete', 'numeroProcesso' => $model->numeroProcesso, 'Usuario_matricula' => $model->Usuario_matricula, 'Audiencia_codigo' => $model->Audiencia_codigo, 'Preatendimento_idPreatendimento' => $model->Preatendimento_idPreatendimento, 'Preatendimento_Usuario_matricula' => $model->Preatendimento_Usuario_matricula, 'Preatendimento_Interessado_cpf' => $model->Preatendimento_Interessado_cpf], ['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' => ['numeroProcesso', 'classe', 'situacao', 'dataCriacao', 'Usuario_matricula', 'Audiencia_codigo', 'Preatendimento_idPreatendimento', 'Preatendimento_Usuario_matricula', 'Preatendimento_Interessado_cpf']]);
?>
</div>
示例7:
use yii\helpers\Html;
use yii\widgets\DetailView;
/**
* @var yii\web\View $this
* @var mdm\admin\models\AuthItem $model
*/
$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => Yii::t('rbac-admin', 'Rules'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="auth-item-view">
<!-- <h1><?php
echo Html::encode($this->title);
?>
</h1> -->
<p>
<?php
echo Html::a(Yii::t('rbac-admin', 'Update'), ['update', 'id' => $model->name], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a(Yii::t('rbac-admin', 'Delete'), ['delete', 'id' => $model->name], ['class' => 'btn btn-danger', 'data-confirm' => Yii::t('rbac-admin', 'Are you sure to delete this item?'), 'data-method' => 'post']);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['name', 'className']]);
?>
</div>
示例8:
use yii\helpers\Html;
use yii\widgets\DetailView;
use frontend\models\Preatendimento;
/* @var $this yii\web\View */
/* @var $model frontend\models\Audiencia */
$this->title = 'Nº do Processo: ' . ' ' . $model->preatendimentoIdpreatendimento->numeroprocesso;
$this->params['breadcrumbs'][] = ['label' => 'Audiencias', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="audiencia-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Atualizar', ['update', 'id' => $model->idaudiencia], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Remover', ['delete', 'id' => $model->idaudiencia], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Tem certeza de que deseja excluir este item?', 'method' => 'post']]);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['data', 'hora', ['attribute' => 'preatendimento_idpreatendimento', 'value' => $model->preatendimentoIdpreatendimento->numeroprocesso]]]);
?>
</div>
示例9:
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\Book */
$this->title = $model->title;
$this->params['breadcrumbs'][] = ['label' => 'Books', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="book-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Delete', ['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', 'title', 'description', 'author_id', 'isbn']]);
?>
</div>
示例10:
</h3></div>
<div class="col-lg-4 col-sm-4 col-xs-12 no-padding" style="padding-top: 20px !important;">
<div class="col-xs-4 left-padding">
<?php
echo Html::a(Yii::t('stu', 'Back'), ['index'], ['class' => 'btn btn-block btn-back']);
?>
</div>
<div class="col-xs-4 left-padding">
<?php
echo Html::a(Yii::t('stu', 'Update'), ['update', 'id' => $model->stu_status_id], ['class' => 'btn btn-block btn-info']);
?>
</div>
<div class="col-xs-4 left-padding">
<?php
echo Html::a(Yii::t('stu', 'Delete'), ['delete', 'id' => $model->stu_status_id], ['class' => 'btn btn-block btn-danger', 'data' => ['confirm' => Yii::t('stu', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="box box-primary view-item">
<div class="stu-status-view">
<?php
echo DetailView::widget(['model' => $model, 'options' => ['class' => 'table detail-view'], 'attributes' => ['stu_status_name', 'stu_status_description', ['attribute' => 'created_at', 'value' => Yii::$app->formatter->asDateTime($model->created_at)], ['attribute' => 'created_by', 'value' => $model->createdBy->user_login_id], ['attribute' => 'updated_at', 'value' => $model->updated_at == null ? " - " : Yii::$app->formatter->asDateTime($model->updated_at)], ['attribute' => 'updated_by', 'value' => $model->updated_by == null ? " - " : $model->updatedBy->user_login_id]]]);
?>
</div>
</div>
</div>
示例11:
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\MaprintLayouts */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Maprint Layouts', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="maprint-layouts-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Delete', ['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', 'maprint_id', 'layout:ntext', 'label:ntext']]);
?>
</div>
示例12:
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\WordsGroup */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => 'Words Groups', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="words-group-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Update', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Delete', ['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', 'projekt_id', 'group_name', 'description']]);
?>
</div>
示例13:
$this->title = $model->ID_CONTRACT;
$this->params['breadcrumbs'][] = ['label' => 'Contratos', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="contrato-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Actualizar', ['update', 'id' => $model->ID_CONTRACT], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Eliminar', ['delete', 'id' => $model->ID_CONTRACT], ['class' => 'btn btn-danger', 'data' => ['confirm' => 'Are you sure you want to delete this item?', 'method' => 'post']]);
?>
<?php
echo Html::a('<i class="fa glyphicon glyphicon-hand-up"></i> Descargar PDF', ['imprimir', 'id' => $model->ID_CONTRACT], ['class' => 'btn btn-success']);
?>
</p>
<?php
echo DetailView::widget(['model' => $model, 'attributes' => ['ID_CONTRACT', 'iDCOL.NAME_COL', 'ID_ADMIN', 'DETAIL']]);
?>
</div>
示例14:
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model frontend\models\Academic */
$this->title = $model->academic_id;
$this->params['breadcrumbs'][] = ['label' => 'Academics', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="academic-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a('Update', ['update', 'id' => $model->academic_id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a('Delete', ['delete', 'id' => $model->academic_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' => ['Public_high_school_graduating_from', 'complete_school_address', 'principal_fullname', 'section_no', 'organization:ntext', 'position_held:ntext', 'academic_id']]);
?>
</div>
示例15:
<?php
use yii\helpers\Html;
use yii\widgets\DetailView;
use dosamigos\fileupload\FileUpload;
use dosamigos\fileupload\FileUploadUI;
use common\models\Advert;
use common\models\AdvertFile;
use common\models\City;
$this->title = 'Просмотр';
$this->params['breadcrumbs'][] = ['label' => 'Объявления', 'url' => ['/advert/list']];
$this->params['breadcrumbs'][] = ['label' => '№ ' . $model->id, 'url' => ['view', 'id' => $model->id]];
$this->params['breadcrumbs'][] = $this->title;
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'type', 'category', 'user_id', 'city_id', 'created_at:datetime', 'updated_at:datetime', 'content', 'price', 'term', 'views']]);