Silex render form - ChoiceType

Twig
(and sorry for my English) I am working on a Silex project and I start using the form. Without form, i have something like this : And using the f...
2 years ago

Join property values of a list of objects in twig

Twig
Is it possible to join the values of properties of a list of objects for displaying it? Something like: {{ users|join(', ', username) }} Where user...
2 years ago

FOS UserBundle how to add image to registration email twig

Twig
How can I add company log in email twig using FOS UserBundle? I do want to do it with in the twig files and don't want to create a custom mailer class...
2 years ago

How to access $_POST in Twig form?

Twig
I'm trying to print the value of the input field 'gameTitle' in Twig. This is my code: <h1>New game</h1> <form method="post" action="...
3 years ago

Cannot access Eloquent attributes on Twig

Twig
I am trying to access an Eloquent attribute with Twig in Slim, and getting an error. I have a Field and a Type object, and the relationship is as fol...
2 years ago

Correct way to conditionally hide a content block on certain pages

Twig
What is the best way to hide e.g. a nav bar on certain pages in Timber Twig templates. Have tried wrapping the navbar element in {% if post.title !=...
2 years ago

Grav - skip homepage in menu

Twig
I am making my first Grav website. I'm trying to creating a navigation menu and I'd like it to display links to all visible pages but not the homepa...
2 years ago

How to set up style for all tables in symfony 3 Bootstrap 3/4 twig

Twig
I want to have the same look for all tables and don't set it every time. My view: {% extends 'MyBundle::base.html.twig' %} {% block pageTitle %} I...
2 years ago

Symfony: How To set Cookies and Session variable in an include Twig Controller?

Twig
This is my first post, then if there is/are any problem let me know :) I'm building a website using Symfony, but I currently got a problem: I can't s...
2 years ago

How to use multiple translation files without domains in Twig in Symfony2?

Twig
In the Symfony2 project, I'm working on, the translations are files in multiple domain files like foo.en_GB.xlf bar.en_GB.xlf buz.en_GB.xlf ... foo.d...
3 years ago

Make an Iterable array of objects in PHP for Twig

Twig
I'm trying to pass an array of objects as a parameter for the view rendering. The problem is that when I try to iterate over it and I check if it's it...
2 years ago

How can i get the list of images url's in twig template, Drupal 8?

Twig
I have a content type with image field limited to 10 images. I need to get the list of url's to create a slider in the template. I'm able to access th...
3 years ago

Get base_path in twig file -- Drupal 8

Twig
How can i get the base path of drupal installation in twig file? For example i need to get http://localhost/drupal/. I have tried {{ base_path }} ...
2 years ago

Angular 2 with PHP backend design structure thoughts

Twig
I have a huge project, which has grown over the years. I would like to change, change not refactor, from jQuery to Angular 2 in the frontend (this is ...
2 years ago

Symfony, how to set the member as active or not

Twig
i'm useing symfony in my project and i used this code in twig to show active or disactive button on my members list {% for item in members %} <fo...
2 years ago

How can i pass parameters to a Symfony2 Twig block?

Twig
I want to generate table headers in a twig block and reuse them across the page, this page has about 5 different tables with roughly the same headers....
2 years ago

How to use twig rendering for making files?

Twig
I would like to use twig to make js file. These are what I want to do. web/base.js // this is my base file alert("this file is created by " + "{{va...
2 years ago

Extends template in Twig with Twig_Loader_String

Twig
I have to render a template with Twig_Loader_String and I need to extend a template, like below: $body='{% extends "/views/path/to/my/template" %} ...
2 years ago

Symfony 3.2: twig/twig v2.0.0 requires php ^7.0

Twig
I just wanted to install my Symfony 3.2 app on a server with PHP 5.6, and a composer install tells me twig/twig v2.0.0 requires php ^7.0 -> your PH...
2 years ago

Twig loop. control class names

Twig
Im trying in Twig to set different classes depending on how may items that gets rendered. Eg, if only one, if only two, if only three etc I want to se...
2 years ago