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


PHP TbHtml::navbarBrandLink方法代码示例

本文整理汇总了PHP中TbHtml::navbarBrandLink方法的典型用法代码示例。如果您正苦于以下问题:PHP TbHtml::navbarBrandLink方法的具体用法?PHP TbHtml::navbarBrandLink怎么用?PHP TbHtml::navbarBrandLink使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TbHtml的用法示例。


在下文中一共展示了TbHtml::navbarBrandLink方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: run

 /**
  * Runs the widget.
  */
 public function run()
 {
     $brand = $this->brandLabel !== false ? TbHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions) : '';
     ob_start();
     foreach ($this->items as $item) {
         if (is_string($item)) {
             echo $item;
         } else {
             $widgetClassName = TbArray::popValue('class', $item);
             if ($widgetClassName !== null) {
                 $this->controller->widget($widgetClassName, $item);
             }
         }
     }
     $items = ob_get_clean();
     ob_start();
     if ($this->collapse !== false) {
         TbHtml::addCssClass('navbar-collapse', $this->collapseOptions);
         ob_start();
         /* @var TbCollapse $collapseWidget */
         $collapseWidget = $this->controller->widget('\\TbCollapse', array('toggle' => false, 'content' => $items, 'htmlOptions' => $this->collapseOptions));
         $collapseContent = ob_get_clean();
         echo TbHtml::tag('div', array('class' => 'navbar-header'), TbHtml::navbarCollapseLink('#' . $collapseWidget->getId()) . $brand);
         echo $collapseContent;
     } else {
         echo TbHtml::tag('div', array('class' => 'navbar-header'), $brand);
         echo $items;
     }
     $containerContent = ob_get_clean();
     $containerOptions = TbArray::popValue('containerOptions', $this->htmlOptions, array());
     TbHtml::addCssClass('navbar-container', $containerOptions);
     // Change css [container] to [navbar-container]
     ob_start();
     echo TbHtml::openTag('div', $containerOptions);
     echo $containerContent;
     echo '</div>';
     $content = ob_get_clean();
     echo TbHtml::navbar($content, $this->htmlOptions);
 }
开发者ID:noonnightcoder,项目名称:bakou-pos-apsara,代码行数:42,代码来源:TbNavbar.php

示例2: run

 /**
  * Runs the widget.
  */
 public function run()
 {
     $brand = $this->brandLabel !== false ? TbHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions) : '';
     ob_start();
     foreach ($this->items as $item) {
         if (is_string($item)) {
             echo $item;
         } else {
             $widgetClassName = TbHtml::popOption('class', $item);
             if ($widgetClassName !== null) {
                 $this->controller->widget($widgetClassName, $item);
             }
         }
     }
     $items = ob_get_clean();
     ob_start();
     if ($this->collapse !== false) {
         $this->collapseOptions = TbHtml::addClassName('nav-collapse', $this->collapseOptions);
         // todo: fix collapse, currently it cannot be clicked when within a navbar
         ob_start();
         /* @var TbCollapse $collapseWidget */
         $collapseWidget = $this->controller->widget('bootstrap.widgets.TbCollapse', array('toggle' => false, 'content' => $items, 'htmlOptions' => $this->collapseOptions));
         $collapseContent = ob_get_clean();
         echo TbHtml::collapseIcon('#' . $collapseWidget->getId());
         echo $brand . $collapseContent;
     } else {
         echo $brand . $items;
     }
     $containerContent = ob_get_clean();
     $containerOptions = TbHtml::popOption('containerOptions', $this->htmlOptions, array());
     $containerOptions = TbHtml::addClassName($this->fluid ? 'container-fluid' : 'container', $containerOptions);
     ob_start();
     echo TbHtml::openTag('div', $containerOptions);
     echo $containerContent;
     echo '</div>';
     $content = ob_get_clean();
     echo TbHtml::navbar($content, $this->htmlOptions);
 }
开发者ID:jackycgq,项目名称:advanced,代码行数:41,代码来源:TbNavbar.php

示例3: testNavbarBrandLink

 public function testNavbarBrandLink()
 {
     $I = $this->codeGuy;
     $html = TbHtml::navbarBrandLink('Brand text', '#', array('class' => 'link'));
     $a = $I->createNode($html, 'a.brand');
     $I->seeNodeCssClass($a, 'link');
     $I->seeNodeAttribute($a, 'href', '#');
     $I->seeNodeText($a, 'Brand text');
 }
开发者ID:AlexanderGrant1,项目名称:AC41004,代码行数:9,代码来源:TbHtmlTest.php

示例4: run

 /**
  * Runs the widget.
  */
 public function run()
 {
     $brand = $this->brandLabel !== false ? TbHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions) : '';
     ob_start();
     foreach ($this->items as $item) {
         if (is_string($item)) {
             echo $item;
         } else {
             $widgetClassName = TbHtml::popOption('class', $item);
             if ($widgetClassName !== null) {
                 $this->controller->widget($widgetClassName, $item);
             }
         }
     }
     $items = ob_get_clean();
     ob_start();
     echo CHtml::openTag('div', array('class' => $this->fluid ? 'container-fluid' : 'container'));
     if ($this->collapse !== false) {
         $collapseId = TbHtml::getNextId();
         $this->collapseOptions = TbHtml::addClassName('nav-collapse', $this->collapseOptions);
         echo TbHtml::collapseIcon('#' . $collapseId) . PHP_EOL;
         echo $brand . PHP_EOL;
         $this->controller->beginWidget('bootstrap.widgets.TbCollapse', array('id' => $collapseId, 'toggle' => false, 'htmlOptions' => $this->collapseOptions));
         echo $items;
         $this->controller->endWidget();
     } else {
         echo $brand . PHP_EOL;
         echo $items . PHP_EOL;
     }
     echo '</div>';
     $content = ob_get_clean();
     echo TbHtml::navbar($content, $this->htmlOptions);
 }
开发者ID:yii-twbs,项目名称:yiistrap,代码行数:36,代码来源:TbNavbar.php

示例5: run

 /**
  * Runs the widget.
  */
 public function run()
 {
     $brand = $this->brandLabel !== false ? TbHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions) : '';
     ob_start();
     if (!Yii::app()->user->isGuest) {
         $menus = $this->Menudata();
     } else {
         $menus[0] = array();
     }
     $menus[1] = array('class' => 'bootstrap.widgets.TbNav', 'htmlOptions' => array('class' => 'pull-right'), 'items' => array(array('label' => '网站前台', 'url' => Yii::app()->request->hostInfo . Yii::app()->baseUrl), array('label' => '站点配置', 'url' => array('/settings/index'), 'visible' => !Yii::app()->user->isGuest), array('label' => '登录', 'url' => array('/site/login'), 'visible' => Yii::app()->user->isGuest), array('label' => Yii::app()->user->name, 'url' => '#', 'items' => array(array('label' => '个人资料', 'icon' => 'user', 'url' => '#'), array('label' => '退出', 'icon' => 'off', 'url' => array('/site/logout'))), 'visible' => !Yii::app()->user->isGuest)));
     $this->items = $menus;
     foreach ($this->items as $item) {
         if (is_string($item)) {
             echo $item;
         } else {
             $widgetClassName = TbArray::popValue('class', $item);
             if ($widgetClassName !== null) {
                 $this->controller->widget($widgetClassName, $item);
             }
         }
     }
     $items = ob_get_clean();
     ob_start();
     if ($this->collapse !== false) {
         TbHtml::addCssClass('nav-collapse', $this->collapseOptions);
         ob_start();
         /* @var TbCollapse $collapseWidget */
         $collapseWidget = $this->controller->widget('bootstrap.widgets.TbCollapse', array('toggle' => false, 'content' => $items, 'htmlOptions' => $this->collapseOptions));
         $collapseContent = ob_get_clean();
         echo TbHtml::navbarCollapseLink('#' . $collapseWidget->getId());
         echo $brand . $collapseContent;
     } else {
         echo $brand . $items;
     }
     $containerContent = ob_get_clean();
     $containerOptions = TbArray::popValue('containerOptions', $this->htmlOptions, array());
     TbHtml::addCssClass($this->fluid ? 'container-fluid' : 'container', $containerOptions);
     ob_start();
     echo TbHtml::openTag('div', $containerOptions);
     echo $containerContent;
     echo '</div>';
     $content = ob_get_clean();
     echo TbHtml::navbar($content, $this->htmlOptions);
 }
开发者ID:zwq,项目名称:unpei,代码行数:47,代码来源:TbNavbar.php


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