-
Notifications
You must be signed in to change notification settings - Fork 148
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Side nav divider #75
Comments
I don't know if there is one currently - at least nothing's documented. The best way to handle this would be to create a new type of MenuItem, don't you think? |
@MartinLyne if have knowlegde, pull request are welcome to add the side nav divider, thanks |
Dividers are child elements, because that semantically best matches how dividers are represented in the HTML by Bootstrap. Could you try with:
For example:
It should generate something like:
If doesn't work, a way to implement this could be: namespace AppBundle\Menu\Item;
use Knp\Menu\FactoryInterface;
use Knp\Menu\MenuItem;
final class DividerMenuItem extends MenuItem
{
/**
* @param FactoryInterface $factory
*/
public function __construct(FactoryInterface $factory)
{
parent::__construct('divider', $factory);
$this
->setExtra('divider', true)
->setAttribute('class', 'separator')
;
}
} Then, on your builder:
And on theme probable override something like: {% block spanElement %}
{% import 'knp_menu.html.twig' as knp_menu %}
{% if not item.extra('divider') %} {% Don't show menu content if it's a divider %}
<span>{{ knp_menu.attributes(item.labelAttributes) }}>
{% if item.extra('icon') is not empty %}
<i class="{{ item.extra('icon') }}"></i>
{% endif %}
{{ block('label') }}
</span>
{% endif %}
{% endblock %} |
@MartinLyne if you can, please give me your feedback so I can mark as closed or pending to fix if you still need something, thanks! |
Sorry, just had a baby but will get back to you soon hopefully!
|
@MartinLyne congratulations for your new pcntl_fork() for main thread life!! $pid = pcntl_fork();
if ($pid == -1) {
die('Oops some conception problem');
} else if ($pid) {
// MartinLyne is the parent
pcntl_wait($status); //Protect against Zombie children ;)
} else {
// your new baby child life
} When you can leave in safe thread your things, just return here again ;) PS: Probably I will try follow and reproduce your issue/bug with fork() in some years. So all the feedback about the issue is welcome ;) |
Does anyone know if you can add a divider right now? I don't see a mention of one in original AdminLTE repo, just one for drop down menus.
I was thinking of adding it perhaps? Any ideas if it should be a new type of MenuItem? Or just allow null route in the template and use teh classes as normal? You'd end up with an empty
li
tag with whatever class you input in your event listener. Using "divider" would use my new, theoretical css.Planning to use the dropdown menu divider as a basis (maybe it'll just be as simple as duplicating it)
The text was updated successfully, but these errors were encountered: