setting a placeholder attribute with translation in Symfony2 form input

Twig
I am using FOSUserBundle for managing my users. In order to register user, I reused the form of the bundle which meets my needs. Nevertheless, I neede...
2 years ago

Populate table in twig with for loop

Twig
I want to populate my table in twig with a for loop and some if statement. {% for user in users %} <td> {% if user.planningday == 1...
2 years ago

How to translate Symfony 3 forms?

Twig
Translating content in twig templates seems easy and straightforward: I run bin/console translation:update to populate translation files. The issue is...
2 years ago

Symfony forcing translation into different language than the current one

Twig
I have the locale set to one language. Let's say german "de" and I want to have a part of the whole text translated into different languages (Ex. This...
2 years ago

How to access data from twig extension that returns array?

Twig
I have a custom Twig extension that returns an array: $base64Decode = new Twig_Filter('base64_decode', function ($string) { return unserialize(ba...
2 years ago

Twig: use raw filter on form_widget attr

Twig
is it possible to use raw filter on form element attributes? I want something like: {{ form_widget(searchForm.query, { 'type': 'search', 'att...
2 years ago

Symfony 3.3 - uncaught Twig Runtime Exception when attempting to access a flash message in a template

Twig
I have a flashbag that's not guaranteed to actually have a message in it. If it does have a message, I'd like to display it, otherwise just continue ...
2 years ago

Twig - Access array[key +1]

Twig
I have a twig template to which I pass this parameter: mediasInAlbums = array( "albumId1" => array(media1, media2, media3...), "albumId2"...
2 years ago

display twig loop element in bolt

Twig
I would like to create this skeleton with html and twig : group actu 1 actu 2 group actu 3 actu 4 group actu 5 actu 6 3 gro...
2 years ago

Typehint (intellisense) objects within a twig loop

Twig
I've searched for a solution but I can't find any suitable for Twig, I know it's a quality of life thing. But it would make templating slightly easier...
2 years ago

ng click and/or ng change

Twig
Morning, here is what happens. I made a dev, it was working fine, but only with firefox. When i tested it with chrome...it wasn't working at all. So...
2 years ago

Symfony2 how to render all rows of form in twig

Twig
I built a form in symfony with this code: foreach ( $options as $field => $title ) { $form->add( $field, 'text', array('label' => $title...
2 years ago

block javascript don't work

Twig
i have this base.html.twig with materialize.ccs <!DOCTYPE html> <html lang="en"> <!--================================================...
2 years ago

Variable "url_resources" does not exist. Here I'm trying to display the values of form that i just entered above

Twig
enter image description hereVariable "url_resources" does not exist. Here I'm trying to display the values of form that i just entered above. It alway...
2 years ago

Show in twig the result of a JOIN query in Symfony

Twig
I have 2 tables which are not related by ORM so I do theJOIN as follows: $dql="SELECT u, o FROM BackendBundle:Orders o JOIN BackendBundle...
2 years ago

Twig template add leading zero with filter

Twig
I'm converting an integer to a time format in the Twig template system. So that total duration of seconds is converted to hh:mm:ss. Here is an exampl...
2 years ago

return result from function in symfony as global in twig templates

Twig
I have a function that returns the number of items in the cart. How it is possible to display this number in every page of the website? I need to sho...
2 years ago

How to implement multilanguage in Twig?

Twig
How to implement multilanguage in Twig templates? Before using Twig, I used gettext function to implement multilanguage, but I don't know if there i...
2 years ago

best way customize field_error in symfony 3

Twig
i have a entity with path field /** * @var string * @Assert\NotBlank(message="Please, upload scontrino/fattura della stufa acquistata.")...
2 years ago

creating a macro to use in template

Twig
I'm trying to use macros to add some up and down arrows for the sorting in a table used with KnpPaginator. i'm new to macros and the doc is a bit ted...
2 years ago