Symfony2 -> Twig -> Form -> Field -> Set rendered = true
Am I missing the question here? If you want to set a field as rendered even though it is not the simple call is: {% do form.x.setRendered %} If I misunderstood, my apologies.
Am I missing the question here? If you want to set a field as rendered even though it is not the simple call is: {% do form.x.setRendered %} If I misunderstood, my apologies.
Its not possible to access any PHP function inside Twig directly. What you can do is write a Twig extension. A common structure is, writing a service with some utility functions, write a Twig extension as bridge to access the service from twig. The Twig extension will use the service and your controller can use … Read more
In Symfony 2.6 and older versions, to get a parameter in a controller – you should get the container first, and then – the needed parameter. $this->container->getParameter(‘api_user’); This documentation chapter explains it. While $this->get() method in a controller will load a service (doc) In Symfony 2.7 and newer versions, to get a parameter in a … Read more