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