本文整理汇总了PHP中Navigation::unstyled方法的典型用法代码示例。如果您正苦于以下问题:PHP Navigation::unstyled方法的具体用法?PHP Navigation::unstyled怎么用?PHP Navigation::unstyled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Navigation
的用法示例。
在下文中一共展示了Navigation::unstyled方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Writes the current Navbar
*
* @return string A Bootstrap navbar
*/
public function render()
{
$attributes = Helpers::add_class($this->attributes, 'navbar ' . $this->type);
// Open navbar containers
$html = '<div' . Helpers::getContainer('html')->attributes($attributes) . '>';
$html .= '<div class="navbar-inner"><div class="container">';
// Collapsible button if asked for
if ($this->collapsible) {
$html .= '
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>';
}
// Add brand if one was given
if ($this->brand) {
$html .= Helpers::getContainer('html')->link($this->brand['url'], $this->brand['name'], array('class' => 'brand'));
}
if ($this->collapsible) {
$html .= '<div class="nav-collapse">';
}
// Prints out menus
if ($this->menus) {
foreach ($this->menus as $menu) {
if (is_string($menu)) {
$html .= $menu;
} else {
$attr = array_get($menu, 'attributes', array());
$html .= Navigation::unstyled($menu['items'], false, $attr, $this->autoroute);
}
}
}
if ($this->collapsible) {
$html .= '</div>';
}
// Close navbar containers
$html .= '</div></div></div>';
return $html;
}
示例2: render
/**
* Writes the current Navbar
*
* @return string A Bootstrap navbar
*/
public function render()
{
$type = (!empty($this->type)) ? ' ' . $this->type : '';
$attributes = Helpers::add_class($this->attributes, 'navbar' . $type);
// Open navbar containers
$html = '<nav' . Helpers::getContainer('html')->attributes($attributes) . ' role="navigation">';
$html .= '<div class="container">';
// --- Header ---
$html .= '<div class="navbar-header">';
// Collapsible button if asked for
if ($this->collapsible) {
$html .= '
<button type="button" class="btn btn-navbar navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>';
}
// Add brand if one was given
if ($this->brand) {
$brand = $this->brand;
if ($brand['escape']) {
$html .= Helpers::getContainer('html')->link(
$this->brand['url'],
$this->brand['name'],
array('class' => 'navbar-brand')
);
} else {
$url = $brand['url'];
$text = $brand['name'];
$html .= "<a href='$url' class='navbar-brand'>$text</a>";
}
}
$html .= '</div>';
/// --- Header ---
// --- Content ---
$html .= '<div class="navbar-collapse collapse">';
// Prints out menus
if ($this->menus) {
foreach ($this->menus as $menu) {
if (is_string($menu)) {
$html .= $menu;
} // If is string add to html
else {
$attr = array_get($menu, 'attributes', array());
$html .= Navigation::unstyled($menu['items'], false, $attr, $this->autoroute);
}
}
}
$html .= '</div>';
// --- Content ---
// Close navbar containers
$html .= '</div></nav>';
return $html;
}