Pass parameter to all views

Twig
I want to display the user name/last connection date/time and some other info on all of my Twig views (which all extend a common Twig layout). How ca...
5 months ago

Symfony2: pass parameter to all views

Twig
I want to display the user name/last connection date/time and some other info on all of my twig views (which all extend a common twig layout). How ca...
5 months ago

Render custom formType option in twig template

Twig
I have this problem in Symfony 2.8: I can't render a custom variable with my query passed to form option. See the below code what i have tried : Thi...
5 months ago

Symfony 3 override default form rendering

Twig
Symfony's documentation on "custom form rendering" seems vague and misleading. I am attempting to render a custom element on a form, but I'm seeing in...
5 months ago

How to lunch Swiftmailer inside a button function

Twig
I'm using swiftmailer bundle, everything works good, but I still cannot integrate swiftmailer with my function. I have to confirm users after registra...
5 months ago

Symfony Custom Field Template label is rendered twice

Twig
I created a custom form field called 'AgenceSelectType' which is basically an EntityType with Defaults values and a custom theme. Every time I render...
5 months ago

Symfony2 session-flash with if clause in twig isn't working

Twig
I try to react on a setted session-flash but get always the else-path Symfony 2.1.3 Controller: $this->get('session')->getFlashBag()->set(...
5 months ago

Translate messages inside twig in symfony2

Twig
I'm trying to access to the translations via twig. For example, I have the name of my application inside my Resources/translations/messages.de.yml an...
5 months ago

twig path syntax for multiple variables

Twig
Does anyone know the correct syntaxe for a path (in twig) with multiple variables. I know how to do it for just one variable but for more than one ca...
5 months ago

Symfony2: using twig variables inside (imported) javascript

Twig
Let's say the variable is called 'myvar'. I can access its value in twig using {{ myvar }}. I can also use it inside javascript code, if inside the s...
5 months ago

Data inheritence in twig pattern lab

Twig
I am using twig Pattern Lab includes with the longhand syntax (needed for integration reasons), aka {% include "@atoms/path/to/pattern.twig" %}. If I...
5 months ago

Symfony - Setting Flash and Checking in TWIG

Twig
I am trying to set Flash in my controller, then check in TWIG if a Flash has been set. My problem is that TWIG always reports that my Flash has not be...
5 months ago

storing variable in twig?

Twig
i am starting to play with twig, but I am very noob at it. So sorry if the question sounds utterly stupid, but well.. i looked a bit everywhere, and i...
6 months ago

Sending TWIG output to a zip in Symfony for Templating

Twig
I need to create a system that will be able to output a template (a zip with an index.html with all js, css, img etc files as required) based on a set...
5 months ago

Replace a special character from a html with another character not working

Twig
Hi I have a template : fetched from db I need to sent it as email to customer. So I want to replace [[]] with {{}} so that twig can replace actual var...
5 months ago

Symfony2 : Auto htmlentities using Twig

Twig
I'm displaying some variable retrieved in my database using Twig : <p>{{ my_variable }}</p> The thing is this variable may contain html...
5 months ago

How to register a twig extension in php

Twig
I am currently using twig standalone (not with symphony or composer) and am not finding in the documentation on how to register an extension in php. ...
6 months ago

How can I set the default date format for Twig templates in Symfony2?

Twig
Twig documentation describes how to set the default date format for the date filter: $twig = new Twig_Environment($loader); $twig->getExtension('c...
6 months ago

Parse Text In Twig View In ZF2

Twig
I am designing the opening page of my personal web site. I am trying to use the same service function as the 'blog' section opening which retrieves t...
6 months ago

Symfony2/Assetic: Use bundle annotation in asset path for imported HTML files

Twig
I am using Symfony 2.8 for my single page web application. I have a file index.html.twig which is supposed to serve all the required resources. Maybe ...
6 months ago