Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #64 from havvg/feature/fluid-navbar

add fluid support to navbar
  • Loading branch information...
commit 641fce67011af89464b91c9f4cc566517f92f150 2 parents a2ce2c1 + a767c2c
@phiamo authored
View
7 Navbar/GenericNavbar.php
@@ -14,6 +14,7 @@ class GenericNavbar implements NavbarInterface
protected $formTypeClass;
protected $formType;
protected $formView;
+ protected $isFluid = false;
public function __construct($title, $fixedTop, $titleRoute = null, $leftMenu = null, $formTypeClass = null, $rightMenu = null){
$this->title = $title;
@@ -91,4 +92,10 @@ public function makeDropdown($menuItem){
->setDisplay(false)
->setAttribute('class', 'nav secondary-nav');
}
+ public function setFluid($value){
+ $this->isFluid = (bool) $value;
+ }
+ public function getFluid(){
+ return $this->isFluid;
+ }
}
View
5 Resources/config/examples/example_navbar.yml
@@ -2,5 +2,8 @@ services:
mopa_bootstrap.examplemenu_builder:
class: %mopa_bootstrap.navbar.generic%
arguments: ["MopaBootstrapBundle", true, "mopa_bootstrap_welcome", @mopa_bootstrap.examplemenu, @mopa_bootstrap.exampledropdown]
+ # Make the navbar fluid for use in container-fluid.
+ #calls:
+ # - [ setFluid, [ true ] ]
tags:
- - { name: mopa_bootstrap.navbar, alias: frontendNavbar } # The alias is what is used to retrieve the navbar
View
2  Resources/views/Navbar/navbar.html.twig
@@ -1,7 +1,7 @@
{% block navbar %}
<div class="navbar {% if navbar.fixedTop %}navbar-fixed-top{% endif %}">
<div class="navbar-inner">
- <div class="container">
+ <div class="container{% if navbar.fluid %}-fluid{% endif %}">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
Please sign in to comment.
Something went wrong with that request. Please try again.