Commit 282f1528 authored by dj3c1t's avatar dj3c1t

service pour menus

parent 695c0b74
......@@ -35,7 +35,9 @@
{% else %}
<a href="{{ path(item['route']) }}">
{% endif %}
{% if item['glyphicon'] is defined %}
<span class="glyphicon {{ item['glyphicon'] }}" aria-hidden="true"></span>
{% endif %}
{{ item['label'] }}
</a>
</li>
......
......@@ -66,8 +66,18 @@ class Menus {
foreach($yaml["dj3c1t_menus"] as $app_name => $menus) {
foreach($menus as $menuName => $menuValues) {
if($menuName == $this->menuName) {
foreach($menuValues["items"] as $menu_item) {
$this->menu[] = $menu_item;
foreach($menuValues["items"] as $menu_item_infos) {
$menu_item = $menu_item_infos;
if(isset($menu_item_infos["service"])) {
$menu_item = array();
if(isset($menu_item_infos["method"])) {
$menu_service = $this->container->get($menu_item_infos["service"]);
$menu_item = $menu_service->$menu_item_infos["method"]();
}
}
if(isset($menu_item["route"])) {
$this->menu[] = $menu_item;
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment