本文整理汇总了PHP中yii\helpers\BaseUrl::toRoute方法的典型用法代码示例。如果您正苦于以下问题:PHP BaseUrl::toRoute方法的具体用法?PHP BaseUrl::toRoute怎么用?PHP BaseUrl::toRoute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\helpers\BaseUrl
的用法示例。
在下文中一共展示了BaseUrl::toRoute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: toRoute
public static function toRoute($route, $scheme = false)
{
$route[0] = ltrim($route[0], '/');
if (substr_count($route[0], '/') == 2) {
$route[0] = '/' . $route[0];
}
return "/" . I("__orgcode") . parent::toRoute($route, $scheme);
}
示例2: ActiveDataProvider
Pjax::begin();
echo GridView::widget(['layout' => '{summary}<div class="table-responsive">{items}</div>{pager}', 'options' => ['class' => 'grid-view col-xs-12'], 'tableOptions' => ['class' => 'table table-bordered'], 'showFooter' => true, 'pager' => ['options' => ['class' => 'pagination pagination-bottom'], 'maxButtonCount' => 6], 'dataProvider' => new ActiveDataProvider(['query' => $dataQuery, 'pagination' => ['pagesize' => 10]]), 'columns' => [['label' => Yii::t('fin.grid', 'Ref'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model, $key, $index, $column) {
$pagination = $column->grid->dataProvider->pagination;
$html = $pagination->page * $pagination->pageSize + $index + 1;
$html .= '<br/>' . str_pad($model->id, 6, '0', STR_PAD_LEFT);
return $html;
}], ['label' => Yii::t('fin.grid', 'Status'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) use($arrCustomerStatus) {
$status = isset($arrCustomerStatus[$model->status]) ? $arrCustomerStatus[$model->status] : '';
$html = '<span>' . $status . '</span>';
$lblView = Yii::t('button', 'View');
$lblEdit = Yii::t('button', 'Edit');
$arrBtns = [];
$entryId = $model->id;
$urlEdit = BaseUrl::toRoute(['customer/update', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
$urlView = BaseUrl::toRoute(['customer/view', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
$html .= '<br/><div class="btn-group">';
$html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
$html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
$html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
$html .= '</button>';
$html .= '<ul class="dropdown-menu" role="menu">';
$html .= implode('', $arrBtns);
$html .= '</ul></div>';
return $html;
}], ['label' => Yii::t('fin.grid', 'Balance'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'vertical-align: middle; text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: right'], 'format' => 'raw', 'value' => function ($model) {
$labelClass = $model->balance < 0 ? 'label-danger' : 'label-info';
$labelValue = NumberUtils::format(abs($model->balance));
return StringUtils::format('{2}<br/><span class="label {0} pull-right">{1}</span>', [$labelClass, $labelValue, $model->name]);
}, 'footer' => NumberUtils::getIncDecNumber($sumCustomerValue['balance'], ['template' => '<span class="label pull-right {color}">{number}</span>', 'incColor' => 'label-info', 'decColor' => 'label-danger'])]]]);
示例3: getData
/**
* @param string $id The id of the widget
* @param \yii\data\BaseDataProvider $dataProvider The dataprovider for the widget
* @param \Closure $filter The filter to manipulate the data.
* @return array The data required to create the list and pagination.
*/
protected static function getData($id, $dataProvider, $filter)
{
$data = ['id' => $id];
$data['count'] = $dataProvider->getCount();
if (($pagination = $dataProvider->getPagination()) !== false) {
$data['totalCount'] = $dataProvider->getTotalCount();
$data['begin'] = $pagination->getPage() * $pagination->pageSize + 1;
$data['end'] = $data['begin'] + $data['count'] - 1;
if ($data['begin'] > $data['end']) {
$data['begin'] = $data['end'];
}
$data['page'] = $pagination->getPage() + 1;
$data['pageCount'] = $pagination->pageCount;
} else {
$data['totalCount'] = $dataProvider->getTotalCount();
$data['pageCount'] = 1;
$data['page'] = 1;
$data['begin'] = $data['page'] = $data['pageCount'] = 1;
$data['end'] = $data['totalCount'] = $data['count'];
}
$pagination = $dataProvider->getPagination();
if ($pagination !== false) {
$data['pageParam'] = $pagination->pageParam;
$data['pageSizeParam'] = $pagination->pageSizeParam;
$data['pageSizeLimit'] = $pagination->pageSizeLimit;
$data['pageLinks'] = $pagination->getLinks();
$currentPage = $pagination->getPage();
$pageCount = $pagination->getPageCount();
$maxButtonCount = 10;
$beginPage = max(0, $currentPage - (int) ($maxButtonCount / 2));
if (($endPage = $beginPage + $maxButtonCount - 1) >= $pageCount) {
$endPage = $pageCount - 1;
$beginPage = max(0, $endPage - $maxButtonCount + 1);
}
for ($i = $beginPage; $i <= $endPage; $i++) {
$data['pages'][] = ['pageNo' => $i + 1, 'pageUrl' => $pagination->createUrl($i)];
}
}
$sort = $dataProvider->getSort();
if (!($sort === false || empty($sort->attributes) || $dataProvider->getCount() <= 0)) {
$attributes = array_keys($sort->attributes);
$data['sort'] = [];
foreach ($attributes as $name) {
$data['sort'][] = ['name' => $name, 'link' => $sort->createUrl($name)];
}
}
$models = $dataProvider->getModels();
if ($models) {
$data['labels'] = $models[0]->attributeLabels();
}
$controller = Yii::$app->controller->id;
foreach ($models as $key => $model) {
$data['items'][$key] = $filter ? $filter($model) : $model->attributes;
$data['items'][$key]['actions'] = ['viewUrl' => BaseUrl::toRoute(["{$controller}/view", 'id' => $model->primaryKey]), 'viewTitle' => Yii::t('app', 'View'), 'updateUrl' => BaseUrl::toRoute(["{$controller}/update", 'id' => $model->primaryKey]), 'updateTitle' => Yii::t('app', 'Update'), 'deleteUrl' => BaseUrl::toRoute(["{$controller}/delete", 'id' => $model->primaryKey]), 'deleteTitle' => Yii::t('app', 'Delete')];
}
return $data;
}
示例4: function
<script type="text/javascript">
$("#submit_button").click(function(){
$("#loading").show();
$("#show_data").empty();
var regional = $('#regional').val();
var area = $('#area').val();
var provinsi = $('#provinsi').val();
var kota = $('#kota').val();
var nontelkom = $('#nontelkom').val();
$.ajax({
type: "POST",
url: "<?php
echo BaseUrl::toRoute('getdata');
?>
",
data: {regional:regional,area:area,provinsi:provinsi,kota:kota},
success: function(data)
{
$("#loading").hide();
$('#show_data').html(data);
$('#regional').val(regional);
},
error : function(data){
$("#loading").hide();
$('#show_data').show();
}
});
});
示例5: function
}, 'value' => function ($model) use($arrCurrentAssets) {
return isset($arrCurrentAssets[$model->current_assets]) ? $arrCurrentAssets[$model->current_assets] : '';
}, 'footer' => $htmlFooterAdding], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
$btnClass = MasterValueUtils::getColorRow($index);
$lblView = Yii::t('button', 'View');
$lblEdit = Yii::t('button', 'Edit');
$lblCopy = Yii::t('button', 'Copy');
$arrBtns = [];
$entryId = $model->transactions_id;
$urlEdit = BaseUrl::toRoute(['deposit/update', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
$urlView = BaseUrl::toRoute(['deposit/view', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
$urlCopy = BaseUrl::toRoute(['deposit/copy', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlCopy, $lblCopy]);
$html = '<div class="btn-group">';
$html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
$html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
$html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
$html .= '</button>';
$html .= '<ul class="dropdown-menu" role="menu">';
$html .= implode('', $arrBtns);
$html .= '</ul></div>';
return $html;
}]]]);
Pjax::end();
?>
</div>
<?php
示例6: function
}
}
$(document).ready(function (){
$("#button_submit").click(function(){
var name = $("#name").val();
var username = $("#username").val();
var password = $("#password").val();
if(name != '' && username != '' && password != ''){
$.ajax({
type : "POST",
url : "<?php
echo BaseUrl::toRoute('save');
?>
",
data: {name:name,username:username,password:password},
success: function(data){
console.log("sukses");
window.location.reload();
},
error: function(data){
console.log("gagal");
}
});
}else{
alert("Ooops ! these field with (*) cannot be empty")
}
});
示例7: function
return NumberUtils::format($model->share_value);
}, 'footer' => $htmlFooterShareValue], ['label' => Yii::t('fin.grid', 'Description'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => function ($model, $key, $index) {
return ['style' => 'vertical-align: middle; text-align: left; max-width:280px', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
return $model->description;
}], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
$btnClass = MasterValueUtils::getColorRow($index);
$lblView = Yii::t('button', 'View');
$lblEdit = Yii::t('button', 'Edit');
$arrBtns = [];
$entryId = $model->share_id;
$urlEdit = BaseUrl::toRoute(['distribute/update', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
$urlView = BaseUrl::toRoute(['distribute/view', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
$html = '<div class="btn-group">';
$html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
$html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
$html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
$html .= '</button>';
$html .= '<ul class="dropdown-menu" role="menu">';
$html .= implode('', $arrBtns);
$html .= '</ul></div>';
return $html;
}]]]);
Pjax::end();
?>
</div>
<?php
示例8:
use app\modules\yboard\YBoard;
?>
<div class="container">
<div class="row">
<div class="col-md-1" style="padding:5px 0 0 5px;">
<?php
if (!\Yii::$app->user->isGuest) {
echo Html::a(YBoard::t('yboard', 'Mark all read'), ['forum/mark-all-read'], ['class' => 'btn btn-warning btn-xs']);
}
?>
</div>
<div class="col-md-7 hidden-xs">
</div>
<div class="col-md-4 hidden-xs" style="padding:5px 0 5px 5px;">
<?php
echo Html::dropDownList('yboard-jumpto', '', ArrayHelper::map(YBoardForum::getForumOptions(Yii::$app->user->isGuest, Yii::$app->user->id), 'id', 'name', 'group'), ['empty' => YBoard::t('yboard', 'Select forum'), 'onchange' => "\n group = \$(this.options[this.selectedIndex]).closest('optgroup').prop('label');\n window.location.href='" . BaseUrl::toRoute(['forum']) . "?id='+\$(this).val()", 'class' => 'form-control', 'id' => 'forum-categories-list']);
?>
<?php
if (isset($_GET['id'])) {
$this->registerJs("\$('#forum-categories-list option[value=" . $_GET['id'] . "]').prop('selected', true);");
}
?>
</div>
</div>
</div>
示例9: function
$("#show_data").empty();
var regional = $('#regional').val();
var area = $('#area').val();
var provinsi = $('#provinsi').val();
var kota = $('#kota').val();
var badan_hukum = $('#badan_hukum').val();
var bidang_usaha = $('#bidang_usaha').val();
var omset = $('#omzet').val();
var jml_cabang = $('#jml_cabang').val();
var jml_pegawai = $('#jml_pegawai').val();
var jml_komp = $('#jml_komp').val();
$.ajax({
type: "POST",
url: "<?php
echo BaseUrl::toRoute('postprospek');
?>
",
data: {regional:regional,area:area,provinsi:provinsi,kota:kota,badanhukum:badan_hukum,bidangusaha:bidang_usaha,omset:omset,jmlcabang:jml_cabang,jmlpegawai:jml_pegawai,jmlkomp:jml_komp},
success: function(data)
{
$("#loading").hide();
$('#show_data').html(data);
$('#regional').val(regional);
},
error : function(data){
$("#loading").hide();
$('#show_data').show();
}
});
});
示例10: function
}, 'footer' => $htmlFooterOtherFee], ['label' => Yii::t('fin.grid', 'Investment'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => function ($model, $key, $index) {
return ['style' => 'vertical-align: middle; text-align: right', 'class' => MasterValueUtils::getColorRow($index)];
}, 'value' => function ($model) {
return NumberUtils::format($model->purchase + $model->transfer_fee + $model->other_fee);
}, 'footer' => $htmlFooterInvestment], ['label' => Yii::t('fin.grid', 'Action'), 'headerOptions' => ['style' => 'text-align: center; width: 100px;'], 'contentOptions' => function ($model, $key, $index) {
return ['style' => 'vertical-align: middle; text-align: center', 'class' => MasterValueUtils::getColorRow($index)];
}, 'format' => 'raw', 'value' => function ($model, $key, $index) {
$btnClass = MasterValueUtils::getColorRow($index);
$lblView = Yii::t('button', 'View');
$lblEdit = Yii::t('button', 'Edit');
$urlEdit = null;
$arrBtns = [];
$entryId = $model->id;
$urlEdit = BaseUrl::toRoute(['purchase/update', 'id' => $model->id]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
$urlView = BaseUrl::toRoute(['purchase/view', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
$html = '<div class="btn-group">';
$html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
$html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
$html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
$html .= '</button>';
$html .= '<ul class="dropdown-menu" role="menu">';
$html .= implode('', $arrBtns);
$html .= '</ul></div>';
return $html;
}]]]);
Pjax::end();
?>
</div>
<?php
示例11: function
$html = '<span class="' . ($model->entry_status == MasterValueUtils::MV_JAR_ENTRY_TYPE_TEMP ? 'text-red' : '') . '">' . $html . '<span>';
return $html;
}, 'footer' => Yii::t('fin.grid', 'Total')], ['label' => Yii::t('fin.grid', 'Date'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) {
$html = DateTimeUtils::htmlDateFormatFromDB($model->entry_date, DateTimeUtils::FM_VIEW_DATE, true);
$lblView = Yii::t('button', 'View');
$lblEdit = Yii::t('button', 'Edit');
$urlEdit = null;
$arrBtns = [];
$entryId = $model->id;
if ($model->share_id > 0) {
$urlEdit = BaseUrl::toRoute(['distribute/update', 'id' => $model->share_id]);
} else {
$urlEdit = BaseUrl::toRoute(['payment/update', 'id' => $entryId]);
}
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
$urlView = BaseUrl::toRoute(['payment/view', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
$html .= '<br/><div class="btn-group">';
$html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
$html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
$html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
$html .= '</button>';
$html .= '<ul class="dropdown-menu" role="menu">';
$html .= implode('', $arrBtns);
$html .= '</ul></div>';
return $html;
}, 'footer' => $htmlFooterDate], ['label' => Yii::t('fin.grid', 'Credit / Debit'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: left; min-width:162px'], 'format' => 'raw', 'value' => function ($model) use($arrAccount) {
$htmls = [];
$htmlCredit = isset($arrAccount[$model->account_target]) ? $arrAccount[$model->account_target] : '';
if (!empty($htmlCredit)) {
$amount = $model->account_target == 0 ? '' : NumberUtils::format($model->entry_value);
示例12:
/* @var $this \yii\web\View */
/* @var $content string */
$this->beginContent('@frontend/views/layouts/_clear.php');
?>
<?php
echo $content;
?>
<div class="xfk" id="js_xfk">
<ul>
<li><a href="<?php
echo BaseUrl::toRoute('/learn');
?>
"><img src="/frontend/web/img/a1.png"/><br/><span>新手学堂</span></a></li>
<li><a href="<?php
echo BaseUrl::toRoute('/user');
?>
"><img src="/frontend/web/img/a2.png"/><br/><span>会员中心</span></a></li>
<li><a href="<?php
echo BaseUrl::toRoute('my-click/index');
?>
"><img src="/frontend/web/img/a3.png"/><br/><span>我的点击</span></a></li>
<li><a href="<?php
echo BaseUrl::toRoute('vip/get-pay');
?>
"><img src="/frontend/web/img/a4.png"/><br/><span>提取佣金</span></a></li>
</ul>
</div>
<?php
$this->endContent();
示例13: implode
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
$html .= '<br/><div class="btn-group">';
$html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-xs btn-info']);
$html .= '<button type="button" class="btn btn-xs btn-info dropdown-toggle" data-toggle="dropdown">';
$html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
$html .= '</button>';
$html .= '<ul class="dropdown-menu" role="menu">';
$html .= implode('', $arrBtns);
$html .= '</ul></div>';
return $html;
}, 'footer' => $htmlFooterCredit], ['label' => Yii::t('fin.grid', 'Credit / Debit'), 'headerOptions' => ['style' => 'text-align: center'], 'footerOptions' => ['style' => 'text-align: right'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: left'], 'format' => 'raw', 'value' => function ($model) {
$htmls = [];
if ($model->credit > 0) {
$htmls[] = '<span class="label label-info pull-right">' . NumberUtils::format($model->credit) . '</span>';
}
if ($model->debit > 0) {
$htmls[] = '<span class="label label-danger pull-right">' . NumberUtils::format($model->debit) . '</span>';
}
return implode('<br/>', $htmls);
}, 'footer' => $htmlFooterDebit], ['label' => Yii::t('fin.grid', 'Bill Date'), 'headerOptions' => ['style' => 'text-align: center'], 'contentOptions' => ['style' => 'vertical-align: middle; text-align: center'], 'format' => 'raw', 'value' => function ($model) {
if ($model->order_id > 0 && !is_null($model->bill_date)) {
$urlEdit = BaseUrl::toRoute(['bill/update', 'id' => $model->order_id]);
return StringUtils::format('<a href="{0}">{1}</a>', [$urlEdit, DateTimeUtils::htmlDateFormatFromDB($model->bill_date, DateTimeUtils::FM_VIEW_DATE, true)]);
}
return '';
}]]]);
Pjax::end();
?>
</div></div>
</div></div></div>
示例14: switch
switch ($model->entry_status) {
case MasterValueUtils::MV_FIN_ENTRY_TYPE_SIMPLE:
$urlEdit = BaseUrl::toRoute(['payment/update', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
$urlView = BaseUrl::toRoute(['payment/view', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
$urlCopy = BaseUrl::toRoute(['payment/copy', 'id' => $entryId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlCopy, $lblCopy]);
break;
case MasterValueUtils::MV_FIN_ENTRY_TYPE_DEPOSIT:
case MasterValueUtils::MV_FIN_ENTRY_TYPE_INTEREST_DEPOSIT:
$urlEdit = BaseUrl::toRoute(['deposit/update', 'id' => $timeDepositTranId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlEdit, $lblEdit]);
$urlView = BaseUrl::toRoute(['deposit/view', 'id' => $timeDepositTranId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlView, $lblView]);
$urlCopy = BaseUrl::toRoute(['deposit/copy', 'id' => $timeDepositTranId]);
$arrBtns[] = StringUtils::format('<li><a href="{0}">{1}</a></li>', [$urlCopy, $lblCopy]);
break;
default:
break;
}
$html = '<div class="btn-group">';
$html .= Html::a($lblEdit, [$urlEdit], ['class' => 'btn btn-' . $btnClass]);
$html .= '<button type="button" class="btn btn-' . $btnClass . ' dropdown-toggle" data-toggle="dropdown">';
$html .= '<span class="caret"></span><span class="sr-only">Toggle Dropdown</span>';
$html .= '</button>';
$html .= '<ul class="dropdown-menu" role="menu">';
$html .= implode('', $arrBtns);
$html .= '</ul></div>';
return $html;
}]]]);
示例15:
<?php
use yii\helpers\Html;
?>
<h2>You want information?</h2>
<div class="block">
<?php
echo HTML::a('Отчёт 2014', \yii\helpers\BaseUrl::toRoute(\Yii::$app->getModule('diary')->fourteenUrl[0] . "?year=2014"), ['title' => "", 'style' => 'text-decoration: none;']);
?>
</div>
<div class="block">
<?php
echo HTML::a('Отчёт 2015', \yii\helpers\BaseUrl::toRoute(\Yii::$app->getModule('diary')->fourteenUrl[0] . "?year=2015"), ['title' => "", 'style' => 'text-decoration: none;']);
?>
</div>