mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-08 08:49:52 +00:00
send rendering of menu to devoted controller
This commit is contained in:
parent
3baf7acfb5
commit
b89c5e3de4
@ -1,13 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace CL\Chill\PersonBundle\Controller;
|
|
||||||
|
|
||||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
|
||||||
|
|
||||||
class DefaultController extends Controller
|
|
||||||
{
|
|
||||||
public function indexAction($name)
|
|
||||||
{
|
|
||||||
return $this->render('CLChillPersonBundle:Default:index.html.twig', array('name' => $name));
|
|
||||||
}
|
|
||||||
}
|
|
@ -16,7 +16,7 @@ class PersonController extends Controller {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->render('CLChillPersonBundle:Person:view.html.twig',
|
return $this->render('CLChillPersonBundle:Person:view.html.twig',
|
||||||
array("person" => $person, 'menu_composer' => $this->get('menu_composer'))
|
array("person" => $person)
|
||||||
);
|
);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
{% extends "CLChillPersonBundle::layout.html.twig" %}
|
{% extends "CLChillPersonBundle::layout.html.twig" %}
|
||||||
|
|
||||||
|
{% set activeRouteKey = 'chill_person_view' %}
|
||||||
|
|
||||||
{#
|
{#
|
||||||
|
|
||||||
|
@ -32,9 +32,13 @@
|
|||||||
|
|
||||||
|
|
||||||
<section class="tabs vertical">
|
<section class="tabs vertical">
|
||||||
|
{# Note: activeRouteKey should be defined in Controller or child layout #}
|
||||||
{{ include("CLChillPersonBundle::menu.html.twig",
|
{{ render(controller("CLChillMainBundle:Menu:writeMenu", {
|
||||||
{'person': person, 'menu_composer' : menu_composer, 'route_active': 'chill_person_view' }) }}
|
'menu' : 'person',
|
||||||
|
'layout': 'CLChillPersonBundle::menu.html.twig',
|
||||||
|
'args' : {'id': person.id },
|
||||||
|
'activeRouteKey': activeRouteKey
|
||||||
|
})) }}
|
||||||
|
|
||||||
<div class="tab-content active columns height">
|
<div class="tab-content active columns height">
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
<div class="columns four">
|
<div class="columns four">
|
||||||
<ul class="tab-nav follow-href-path">
|
<ul class="tab-nav follow-href-path">
|
||||||
{% for menu in menu_composer.getRoutesFor('person') %}
|
{% for menu in menu_composer.getRoutesFor(menu) %}
|
||||||
<li class="{% spaceless %}
|
<li class="{% spaceless %}
|
||||||
{% if menu.route == route_active %}
|
{% if menu.route == activeRouteKey %}
|
||||||
active
|
active
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endspaceless %} ">
|
{% endspaceless %} ">
|
||||||
<a href="{{ path(menu.route, {'id': person.id}) }}" >{{ menu.label|trans }}</a>
|
<a href="{{ path(menu.route, args) }}" >{{ menu.label|trans }}</a>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user