Reputation: 466
I have a symfony page composed of 3 parts ( and i'm using tags to display each part) by navigation menu here is the navigation menu.
<ul class="nav nav-tabs centered">
<li class="active">
<a href="#fiche_patient" data-toggle="tab"> {{ 'fiche_pharmacie'|trans }}</a>
</li>
<li>
<a href="#my_team2" data-toggle="tab"> {{ 'Mon équipe'|trans }} </a>
</li>
<li>
<a href="#config" data-toggle="tab"> {{ 'Configuration_automate'|trans }}</a>
</li>
{# <li>
<a href="#tab_3" data-toggle="tab"> {{ 'Services'|trans }} </a>
</li> #}
</ul>
After that i call 3 twig pages to display each page content.
<div class="tab-pane" id="fiche_patient">
{{ include(':prof/Entreprise:indexdetails.html.twig') }}
</div>
<div class="tab-pane" id="my_team2">
{{ include(':prof/Entreprise:my-team.html.twig') }}
</div>
<div class="tab-pane" id="config">
{{ include(':prof/Entreprise:config.html.twig') }}
</div>
My probleme is after submit i would like to display config.html.twig page.
In my controler i tried :
return $this->redirect($this-> generateUrl('entreprise_index'.'#config'));
but it doesn't work Any one of you have an idea ?
Upvotes: 0
Views: 1143
Reputation: 2710
The correct syntax for what you are trying to do there is:
return $this->redirect($this->generateUrl('entreprise_index').'#config');
Upvotes: 3
Reputation: 323
You can send the tab name as a parameter to twig. And, in the template, set the active tab according to that parameter.
Upvotes: 0
Reputation: 5673
You can use redirectToRoute()
$yourRouteParams = array('param1'=>1);
return $this->redirectToRoute('entreprise_index', $yourRouteParams);
Upvotes: 0