Answer the question
In order to leave comments, you need to log in
How in symfony 3.4 to display the login (or any data) in the base template?
Hello! When creating routes in the controller, I can pass the variables I need to the template I need:
//...
return $this->render('@App/some.html.twig', [
'some_key' => $some_var,
]);
//...
{% extends '@App/layout.html.twig' %}
{# ... #}
{% block body %}
{{ some_key }}
{% endblock %}
{# ... #}
Answer the question
In order to leave comments, you need to log in
1. Rendering a controller inside a template
https://symfony.com/doc/3.4/templating/embedding_c...
{{ render(controller(
AppBundle:Article:recentArticles',
{ 'max': 3 }
)) }}
app
, for example, the same instance of the logged in user Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question