當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。