本文整理匯總了PHP中ListView::widget方法的典型用法代碼示例。如果您正苦於以下問題:PHP ListView::widget方法的具體用法?PHP ListView::widget怎麽用?PHP ListView::widget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ListView
的用法示例。
在下文中一共展示了ListView::widget方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model frontend\models\Agreements */
$this->title = $model->id;
$this->params['breadcrumbs'][] = ['label' => Yii::t('app', 'Agreements'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="agreements-view">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<p>
<?php
echo Html::a(Yii::t('app', 'Update'), ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
<?php
echo Html::a(Yii::t('app', 'Delete'), ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => Yii::t('app', 'Are you sure you want to delete this item?'), 'method' => 'post']]);
?>
</p>
<?php
echo ListView::widget(['dataProvider' => $dataProvider, 'itemView' => '_view']);
?>
</div>
示例2:
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'About Us';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="about-us-index">
<h1><?php
echo Html::encode($this->title);
?>
</h1>
<?php
// echo $this->render('_search', ['model' => $searchModel]);
?>
<?php
Pjax::begin();
?>
<?php
echo ListView::widget(['dataProvider' => $dataProvider]);
?>
<?php
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['attribute' => 'aboutustype_id', 'value' => 'aboutustype.type'], 'subsection', 'suborder']]);
?>
<?php
Pjax::end();
?>
</div>
示例3: array
);
}
echo Nav::widget([
'items' => $items,
'options' => ['class' =>'navbar-nav'], // set this to nav-tab to get tab-styled navigation
]); ?>
</div><!-- /.navbar-collapse -->
</div><!-- /.container-fluid -->
</nav>
<div class="container">
<?php
echo ListView::widget(['options' => ['class' => 'row'], 'dataProvider' => $all2, 'itemOptions' => ['class' => 'col-md-6 col-lg-4'], 'layout' => "{items}\n{pager}\n", 'itemView' => '_service_panel_two', 'viewParams' => array('example' => $example)]);
?>
</div>
<div class="text-center" style=" padding:50px 0px;"> <!-- background-color:#121c26; -->
</div>
</div>
<? if (false): ?>
<script type="text/javascript">