how to display a specified value from an multidimensional array in twig template

Twig
I tried to display the service name from the array service. But I did not get the all names. In twig template it only shows the last entered name. Any...
11 months ago

Twig extension: render template with variables

Twig
I have created a twig extension te render a view with some variables , but I have this error An exception has been thrown during the rendering of a t...
11 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...
11 months ago

testing twig with phpunit

Twig
I want to implement some unit tests with Twig and PHPUnit(both installed with composer, with slim/views added). But when I try to test a template gene...
11 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...
11 months ago

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...
11 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...
11 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...
11 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...
11 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...
11 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...
11 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, ...
11 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...
11 months ago

Append onto current URL with Twig?

Twig
I'm currently making a simple file hosting script using Slim, Twig, and PHP. Right now I'm trying to append onto the current URL using Twig but am not...
11 months ago

Parse/search for a certain function in twig templates

Twig
In the latest version of twig, customer functions are to be implemented as Twig_SimpleFunctions as the old method is being deprecated. I have a custo...
11 months ago

Forcing the Twig Locale

Twig
I would like to use the Twig template system to template my e-mails. The locale of the e-mail should be based on a user setting, not from the session ...
11 months ago

Best way to create blocks in Symfony2

Twig
I usually use Symfony2 framework to develope API for mobile applications. But my current task is to develope desktop application for online marketplac...
11 months ago

SonataAdminBundle templates - list and show fields template content duplication

Twig
My list and show fields contain the same content, but due the extending of base_list_field and base_show_field templates I have to create two separate...
11 months ago

what exactly is haswidgets and widgets in bolt (or twig rather )?

Twig
I was just going through the Default theme of bolt CMS, and i came actoss the following lines of code: {% if haswidgets('aside_top') %} {{ w...
11 months ago

PHP how to read comments from twig file?

Twig
How can I read comments in twig files using PHP? test.twig: {# Holy cow Twig is awesome! #} PHP: $tokens = token_get_all(file_get_contents("test....
11 months ago