patricktalmadge/bootstrapper — pull request #97 by rmobis (2013-02-11 19:47:14+00:00)
Title: [Proposal] New 'visible' option on Navbar menus.

Sometimes when building the `Navbar` menu we need to hide/show some menus according to some specific criteria, specially when dealing with login/logout forms and etc.. Now, I find it quite tedious to do it this way, for instance:

````php
$menus = array(
array(
'label'	=> 'Always',
'url'	=> '#'
)
);

if (Auth::guest()) {
$menus[] = array(
'label'	=> 'Login',
'url'	=> '#'
);
}

Navbar::create()
->with_menus($menus);
````

So I'd like to suggest we add `'visible'` as one of the menu attributes, so that we could do something like:

````php
Navbar::create()
->with_menus(array(
array(
'label'	=> 'Always',
'url'	=> '#'
),
array(
'label'	=> 'Login',
'url'	=> '#',
'visible'	=> Auth::gest()
)
));
````

This way, the item would only be output if the `'visible'` attribute evaluates to `true`.

I could work on an implementation if you guys like the idea.