本文整理匯總了PHP中BsHtml::navbarBrandLink方法的典型用法代碼示例。如果您正苦於以下問題:PHP BsHtml::navbarBrandLink方法的具體用法?PHP BsHtml::navbarBrandLink怎麽用?PHP BsHtml::navbarBrandLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BsHtml
的用法示例。
在下文中一共展示了BsHtml::navbarBrandLink方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
/**
* Runs the widget.
*/
public function run()
{
$brand = $this->brandLabel !== false ? BsHtml::navbarBrandLink($this->brandLabel, $this->brandUrl, $this->brandOptions) : '';
ob_start();
foreach ($this->items as $item) {
if (is_string($item)) {
echo $item;
} else {
$widgetClassName = BsArray::popValue('class', $item);
if ($widgetClassName !== null) {
$this->controller->widget($widgetClassName, $item);
}
}
}
$items = ob_get_clean();
ob_start();
if ($this->collapse !== false) {
BsHtml::addCssClass('collapse navbar-collapse', $this->collapseOptions);
ob_start();
/* @var BsCollapse $collapseWidget */
$collapseWidget = $this->controller->widget('bootstrap.widgets.BsCollapse', array('toggle' => false, 'content' => $items, 'htmlOptions' => $this->collapseOptions));
$collapseContent = ob_get_clean();
$collapseLink = BsHtml::navbarCollapseLink('#' . $collapseWidget->getId());
echo BsHtml::tag('div', array('class' => 'navbar-header'), $collapseLink . $brand) . $collapseContent;
} else {
echo BsHtml::tag('div', array('class' => 'navbar-header'), $brand) . $items;
}
$containerContent = ob_get_clean();
if (isset($this->position) && ($this->position === BsHtml::NAVBAR_POSITION_FIXED_TOP || $this->position === BsHtml::NAVBAR_POSITION_STATIC_TOP)) {
$fluid = BsArray::popValue('containerOptions', $this->htmlOptions, false);
$containerOptions = BsArray::popValue('containerOptions', $this->htmlOptions, array());
$containerClass = 'container';
if ($fluid) {
$containerOptions = BsArray::removeValue('fluid', $this->htmlOptions, array());
$containerClass = 'container-fluid';
}
BsHtml::addCssClass($containerClass, $containerOptions);
$content = BsHtml::tag('div', $containerOptions, $containerContent);
echo BsHtml::navbar($content, $this->htmlOptions);
return;
}
echo BsHtml::navbar($containerContent, $this->htmlOptions);
}