本文整理汇总了PHP中yii\bootstrap\Html::ul方法的典型用法代码示例。如果您正苦于以下问题:PHP Html::ul方法的具体用法?PHP Html::ul怎么用?PHP Html::ul使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\Html
的用法示例。
在下文中一共展示了Html::ul方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: function
<?php
/**
* @author Albert Gainutdinov <xalbert.einsteinx@gmail.com>
*/
use bl\multilang\entities\Language;
use yii\bootstrap\Html;
use yii\helpers\ArrayHelper;
use yii\helpers\Url;
global $item;
$item = $model;
echo Html::a('<span class="glyphicon glyphicon-remove"></span>', Url::toRoute(['delete', 'id' => $GLOBALS['item']->id]), ['title' => Yii::t('yii', 'Delete'), 'class' => 'btn btn-danger pull-right btn-xs']) . Html::tag('div', Html::a(Html::tag('span', ' ' . \Yii::t('shop', 'Edit'), ['class' => 'glyphicon glyphicon-pencil']), Url::toRoute(['save', 'id' => $GLOBALS['item']->id, "languageId" => Language::getCurrent()->id]), ['class' => 'btn btn-primary btn-xs']) . Html::a('<span class="caret"></span>', Url::toRoute(['save', 'id' => $GLOBALS['item']->id, "languageId" => Language::getCurrent()->id]), ['class' => 'btn btn-primary btn-xs dropdown-toggle', 'type' => 'button', 'id' => 'dropdownMenu1', 'data-toggle' => 'dropdown', 'aria-haspopup' => 'true', 'aria-expanded' => 'true']) . Html::ul(ArrayHelper::map(Language::find()->all(), 'id', 'name'), ['item' => function ($item, $index) {
return Html::tag('li', Html::a($item, Url::toRoute(['save', 'id' => $GLOBALS['item']->id, "languageId" => $index])));
}, 'class' => 'dropdown-menu', 'aria-labelledby' => 'dropdownMenu1']), ['class' => 'btn-group pull-right m-r-xs']);
示例2:
<?php
use yii\bootstrap\Html;
use common\models\User;
use kartik\icons\Icon;
echo Html::ul(['<small class="text-muted">Рейтинг:</small> ' . User::findOne(Yii::$app->user->id)->rating, '<small class="text-muted">Баланс:</small> ' . preg_replace('/\\,00/', '', number_format(User::findOne(Yii::$app->user->id)->money, 2, ',', ' ')) . ' ' . Icon::show('rub', [], Icon::FA)], ['encode' => false, 'class' => 'list-unstyled']);