当前位置: 首页>>代码示例>>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;未经允许,请勿转载。