当前位置: 首页>>代码示例>>PHP>>正文


PHP ButtonDropdown::run方法代码示例

本文整理汇总了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();
 }
开发者ID:oakcms,项目名称:oakcms,代码行数:9,代码来源:ButtonDropdown.php

示例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();
     }
 }
开发者ID:snivs,项目名称:semanti,代码行数:21,代码来源:LanguageSwitcher.php

示例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();
     }
 }
开发者ID:loveorigami,项目名称:yii2-i18n-url,代码行数:28,代码来源:LanguageSwitcher.php

示例4: run

 public function run()
 {
     parent::run();
     $this->registerTableExportPlugin();
 }
开发者ID:2amigos,项目名称:yii2-table-export-widget,代码行数:5,代码来源:ButtonTableExport.php


注:本文中的yii\bootstrap\ButtonDropdown::run方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。