當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Nav::run方法代碼示例

本文整理匯總了PHP中yii\bootstrap\Nav::run方法的典型用法代碼示例。如果您正苦於以下問題:PHP Nav::run方法的具體用法?PHP Nav::run怎麽用?PHP Nav::run使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在yii\bootstrap\Nav的用法示例。


在下文中一共展示了Nav::run方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: run

 /**
  * @inheritdoc
  */
 public function run()
 {
     if ($this->direction == 'left') {
         $this->options['class'] .= ' drop-left';
     }
     $itemTree = $this->generateItemsTree($this->items);
     $this->items = $this->createItems($itemTree);
     return parent::run();
 }
開發者ID:bariew,項目名稱:yii2-dropdown-x,代碼行數:12,代碼來源:Nav.php

示例2: run

 /**
  * Renders the widget.
  */
 public function run()
 {
     // icon support
     foreach ($this->items as &$item) {
         if (isset($item['icon'])) {
             $icon = FA::icon($item['icon']);
             $item['label'] = trim($icon . ' ' . ArrayHelper::getValue($item, 'label', ''));
             $item['encode'] = false;
             unset($item['icon']);
         }
     }
     return parent::run();
 }
開發者ID:e-jhonny,項目名稱:yii2-bootstrap,代碼行數:16,代碼來源:Nav.php

示例3: run

 public function run()
 {
     $languages = $this->languages;
     //print_pre(Yii::$app->language,'default language');
     $current = $languages[Yii::$app->language];
     unset($languages[Yii::$app->language]);
     $items = [];
     foreach ($languages as $code => $language) {
         $temp = [];
         $temp['label'] = $language;
         $temp['url'] = Url::current(['language' => $code]);
         array_push($items, $temp);
     }
     $this->items[] = ['label' => $current, 'items' => $items];
     FlagsAsset::register($this->view);
     echo parent::run();
 }
開發者ID:EuresTools,項目名稱:eVote-web,代碼行數:17,代碼來源:languageSwitcher.php

示例4: run

 public function run()
 {
     if (!$this->vocabularyName) {
         throw new InvalidConfigException('vocabularyName not set');
     }
     foreach ($this->getTerms() as $term) {
         $this->items[$term->id]['label'] = $term->name;
         $this->items[$term->id]['url'] = Url::toRoute([$this->termRoute, 'term' => $term->id, 'name' => $term->nameSlug]);
         if ($this->termCurrent == $term->id) {
             $this->items[$term->id]['active'] = true;
         }
         if ($term->child) {
             foreach ($term->child as $child) {
                 /** @var $term TaxonomyTerm */
                 $this->items[$term->id]['items'][$child->id] = ['label' => $child->name, 'url' => Url::toRoute([$this->termRoute, 'term' => $child->id, 'name' => $child->nameSlug])];
             }
         } else {
             /** @var $term TaxonomyTerm */
             $this->items[$term->id]['url'] = Url::toRoute([$this->termRoute, 'term' => $term->id, 'name' => $term->nameSlug]);
         }
     }
     parent::run();
 }
開發者ID:artkost,項目名稱:yii2-taxonomy,代碼行數:23,代碼來源:TermsListNav.php


注:本文中的yii\bootstrap\Nav::run方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。