Twig - Replacing double quotation in an href inside data-description

Twig
I'm having trouble building out a data-description which will contain an href. The stored value contains double quotation marks, which obviously cause...
4 months ago

Navigating CraueFormFlowBundle when editing existing entity

Twig
I created a multipage form using CraueFormFlowBundle. With this form I can create a new entity object or edit an existing one. I then added the sett...
4 months ago

Symfony Download variable as String

Twig
on my sympfony webapp should simply search a database for the right file and present a download link/button to get the file. But i only have a variabl...
4 months ago

How to perform RegEx using Twig?

Twig
Is it possible to regex on a string in twig? My string is <a class="twitter-timeline" data-dnt="true" href="https://twitter.com/example" data-wi...
4 months ago

Custom the style of each element in a loop [symfony2]

Twig
I'm rendering a list of categories from my database in my index page, i don't know how to give a unique style to each category, it's easy to give a un...
4 months ago

twig filter multiple parameters

Twig
I'm trying to create a specific twig filter that can handle 2 parameters. $documentURL = new Twig_SimpleFilter('documentURL', function($DocumentId, ...
4 months ago

Symfony3 Variable does not exist in including template

Twig
I get the following error: Variable "file" does not exist. The included template Contractor:file.html.twig looks like this: {{ dump(file) }} The m...
4 months ago

IF a == true OR b == true statement

Twig
I can't find a way to have TWIG interpret the following conditional statement: {% if a == true or b == true %} do stuff {% endif %} Am I missing so...
4 months ago

Create a link with an anchor with Twig path function in Symfony 2

Twig
I'm trying to create a link with an anchor like "www.example.com/services#anchor1" in my Twig template. So far I've been using the path function to cr...
4 months ago

Trying to get this Twig (Symfony2) function extension to register

Twig
I'm getting an error: "twig extension FatalErrorException: Error: Class Acme\Bundle\MyBundle\Twig not found in app/cache/dev/appDevDebugProjectContain...
3 months ago

Can I extract an associative array into variables?

Twig
Lets say I have an associative array like so: {% set settings = { 'foo':'bar', 'cat':'mouse', 'apple':'banana' } %} To use this data I would do the...
3 months ago

TWIG, dynamic associative array key

Twig
I need to create a array with a dynamic key. Example: {% set key = 'a' %} {% set value = 'b' %} {% set array = {key:value} %} ...
3 months ago

Controller attributes cannot contain non-scalar\/non-null values

Twig
I would like to provide my controller object like this with hinclude.js : {{ render_hinclude(controller("AppBundle:Default:Test"), { 'object': my_obj...
3 months ago

Index value in for loop with Twig

Twig
I'd like to store the iteration value to use in data-target so it would be #question0, #quesion1, #question2 and so on... I tried using {{item.id}} b...
3 months ago

How to get the current user in twig extension service [symfony2.8]

Twig
I'm trying to get the current user in my NotificationExtension.php. But the page become very slow to load and I also get this error: Error: Call t...
3 months ago

Twig accessing array values using variables

Twig
{% set key = 'something' %} My array has key something, I and can it access array['something'], but when I try to use variable in key like: array[k...
3 months ago

Can Twig count the array lenght with a filter parameter

Twig
I have an Account object that contains an one-to-many relation with the newsbrief members. In Twig a want to show the quantity of members. I know that...
3 months ago

Convert Twig array to a PHP array

Twig
Using file_get_contents I'm able to get the contents of a twig file which contains just one multidimensional array: Twig: {% set settings = { them...
3 months ago

Conflict on Template of Twig and Vue.js

Twig
I'm doing a program using Slim 2 that uses Twig as my templating engine. so It uses the syntax {{ foo }} in php file. On the other hand, I'm using vue...
4 months ago

Using twig variable inside load jQuery

Twig
I have a problem with including twig inside load function of jQuery, here is an example: <!-- src/MyBundle/Ressources/views/index.html.twig -->...
4 months ago