Form tag attributes in Symfony2 / Twig

Twig
When I want to add some attributes to symfony2 form elements I can just use the "attr" attribute. But how can I give some id / class / style / other t...
1 year ago

How to install asset manager for UserFrosting login system?

Twig
I use userFrosting for my login system, i have problem to include css files. I used this code {% block stylesheets %} {{ parent() }} <link href=...
11 months ago

Symfony2 Error : The CSRF token is invalid. Please try to resubmit the form

Twig
I've been trying to submit a form which update a Cliente object in modal. When I try to do it this error message showing: The CSRF token is invalid. P...
11 months ago

Sorting in the template, in Symfony2: using Twig to sort a collection of objects by property

Twig
In a Symfony2 project I have a controller that retrieves a number of incidents from the database. These incidents have properties like start_time, sto...
11 months ago

Symfony inheritance isn't working EasyAdmin bundle

Twig
I'm using symfony 3 with EasyAdminBundle I created a new bundle called AdminBundle child of EasyAdminBundle (to override) namespace AdminBundle; us...
11 months ago

Twig check multiple values

Twig
I have about 5 or so tables that are booleans. I want to test all of them and if one or more return true then to do something. So far I have tried s...
11 months ago

JSON encode in Slim framework

Twig
I am having problems sending a JSON encoded array to my view. So I am doing this in my route $data['values'] = array('name'=>'John'); $data['valu...
11 months ago

Adding a Twig Extension class makes compilation errors

Twig
I'm using Silex (1.3) for a project and I wanted to add a Twig extension that complies with the Twig_Extension interface : namespace LizardCMS\Twig\E...
11 months ago

Symfony2 form type entity: Option is not selected

Twig
I use a Symfony2 (2.3) entity form type to load the options of a HTML select from a Doctrine entity: Class RoomFacilityType: public function buildFo...
11 months ago

Id attribute on form tag symfony

Twig
I would like to define a id attribute on my symfony2 forms. I've tried with this in my twig template: {{ form_start(form, {'id': 'form_person_edit'...
11 months ago

How do I get meaningful error message with Twig?

Twig
I'm using Twig without Symphony. It is installed via composer and used with composers autoloader. In bootstrap phase Twig is instantiated as: // lib_...
11 months ago

preg_replace space to line break with twig

Twig
I would like to replace space in string to line break. Before 1 2 3 4 After preg_replace : 1 2 3 4 This is my code: $m_cart = preg_replace('/\...
11 months ago

Symfony: pass parameter to Ajax url

Twig
I am trying to figure out how to enable/disable user with checkbox without page reload. index.html.twig <table> <thead> <tr>...
11 months ago

Call function with parameters from Twig

Twig
Apologies if this has already been asked. I've done some searching and not found a simple solution. I have a symfony/doctrine project. What is the ap...
11 months ago

Doctrine2 - How to setup a query by months?

Twig
Some quick context I am creating a blog archive based on month/year in the sidebar. I'm at the point where I need to show the posts for that month. I ...
11 months ago

Trying to enable XML language in Twig templates in PhpStorm

Twig
In my project I have *.xml.twig files that render XML using the Twig templating engine. Anyone figured out how to enable both XML and Twig code suppor...
11 months ago

adding the default filter apparently "disables" the filter raw

Twig
I'd like to display the raw value of a variable, if this one is empty, the default value N/A should be shown instead. The code below doesn't work, bu...
11 months ago

create parameters in parameters.ini in Symfony2 and access in all Twig Files

Twig
How to create Constant in Symfony2 from a variable defined in parameters.ini so I can use that constant in all twig Files. Example: parameters.ini: ...
11 months ago

Iterating over key-value arrays in Twig?

Twig
I'm (finally) switching my site from Drupal7 to Symfony3. I'm working on migrating my layout to .twig. I've got a question about loops and key-value...
11 months ago

variables {% set %} in a skeleton file's 'block' don't get recognized , and can't be used when extnding the file?

Twig
I have a symfony3/twig skeleton template page1/skeleton.twig {# set default values #} {% block content %} {% set test = { sec...
11 months ago