Symfony set block content from controller
问题 Is there a way to set a template block content from within a controller in Symfony? Is there a way to do something like this from within a controller? $this->get('templating')->setBlockContent('page_title', $page_title); I need to set the page title dynamically and I want to avoid modifying every single action template. I know I can pass the $page_title variable to Controller:render but I don't want to add {% block title %} {{ page_title }} {% endblock %} to every single action template. 回答1: