Hello. In Symfony I am using a base template from which I am building the main layout for my other twig files. Using the base template, at the moment I have this admin.html.twig
fire that extends the base template and overwrites some of the blocks defined in the base template.
My problem is with the block addRecord
which needs to redirect to a specific URL path that would match a routing for a method in one of my controllers. Clicking this changes the URL to /login
instead of /admin/add
thus calling the FOSUserBundle login. Can someone help? Thanks
Here is my code that should change the URL:
{% extends 'base.html.twig' %}
{% block admin %}<a class="navbar-brand" href="/admin">Admin Home</a>{% endblock admin %}
{% block addRecord %} <a class="navbar-brand" href="/admin/add">Add Record</a> {% endblock addRecord %}
Routing from Symfony:
Controller function:
/**
* @Route("/admin/add")
*
*/
public function adminAddRecordAction(Request $request){}