本文整理汇总了PHP中yii\bootstrap\ButtonDropdown::run方法的典型用法代码示例。如果您正苦于以下问题:PHP ButtonDropdown::run方法的具体用法?PHP ButtonDropdown::run怎么用?PHP ButtonDropdown::run使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类yii\bootstrap\ButtonDropdown
的用法示例。
在下文中一共展示了ButtonDropdown::run方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
public function run()
{
$view = $this->getView();
if ($this->clientOptions !== false) {
$js = "\$.widget.bridge('uibutton', \$.ui.button);";
$view->registerJs($js);
}
return parent::run();
}
示例2: run
/**
* Renders the language drop down if there are currently more than one languages in the app.
* If you pass an associative array of language names along with their code to the URL manager
* those language names will be displayed in the drop down instead of their codes.
*/
public function run()
{
$appLanguage = Yii::$app->language;
if (count(Yii::$app->i18n->languages) > 1) {
$items = [];
foreach (Yii::$app->i18n->languages as $lang) {
if ($lang === $appLanguage) {
$this->label = static::label($lang);
}
$item = ['label' => static::label($lang), 'url' => $this->getUrl($lang)];
$items[] = $item;
}
$this->dropdown['items'] = $items;
echo parent::run();
}
}
示例3: run
/**
* Renders the language drop down if there are currently more than one languages in the app.
* If you pass an associative array of language names along with their code to the URL manager
* those language names will be displayed in the drop down instead of their codes.
*/
public function run()
{
$languages = isset(Yii::$app->getUrlManager()->languages) ? Yii::$app->getUrlManager()->languages : [];
if (count($languages) > 1) {
$items = [];
$currentUrl = preg_replace('/' . Yii::$app->language . '\\//', '', Yii::$app->getRequest()->getUrl(), 1);
$isAssociative = ArrayHelper::isAssociative($languages);
foreach ($languages as $language => $code) {
$url = $code . $currentUrl;
if ($isAssociative) {
$item = ['label' => $language, 'url' => $url];
} else {
$item = ['label' => $code, 'url' => $url];
}
if ($code === Yii::$app->language) {
$item['options']['class'] = 'disabled';
}
$items[] = $item;
}
$this->dropdown['items'] = $items;
parent::run();
}
}
示例4: run
public function run()
{
parent::run();
$this->registerTableExportPlugin();
}