本文整理匯總了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();
}