Output array in Twig

Twig
I trying to output array from database to screen. In my entity: /** * @ORM\Column(type="array", nullable=true) */ private $category; In my twig ...
5 months ago

Can't exploit properly an array with twig

Twig
I created an entity that I want to use to save events such as "[this user] accepted / declined the mission". So far I have no problem to save the even...
5 months ago

Accessing the logged-in user in a template

Twig
I'm using FOSuserbundle to get started with User registration https://github.com/FriendsOfSymfony/FOSUserBundle I've got it registering / logging in ...
5 months ago

Generating Table Content with TWIG in for loop

Twig
I've got a table, that content got generated in a twig template. Every column that got generated executes the code below. What I need to do is the f...
5 months ago

Twig include CSS or Java Script

Twig
I am completely new to Twig. I have a Twig project, but I do not manage to configure paths to css and js file in the project. The packages I have ins...
5 months ago

How do you get the current url in Twig?

Twig
Inside a twig template I will check if url is: http://example.com/search?keyword=test {% set pageTitle = query %} query is test else {% set page...
5 months ago

Generate the HTML template equivalent of a twig file?

Twig
I'd like to know if it's possible to have {filename}.html generated for every {filename}.html.twig? I know one solution is to copy and paste the sourc...
5 months ago

Setting a Quiz System

Twig
I'm developing a MCQs based Quiz system where my goal is to assist teacher in adding a new Question and Choices for that question on the same page. Ac...
5 months ago

twig: check if all included arrays in an object are empty

Twig
I have a twig variable containing a number of named array objects like this: {{ dump(trashbin) }} Output: array:2 [ "Campaign" => [] "Clien...
4 months ago

Drupal 8 how to pass a value to menu twig template

Twig
I am new to Drupal, I want to pass domain URL to use in menu.html.twig template. How can I do this. Actually I have a menu of 5 domains all pointing t...
4 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...
4 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...
4 months ago

Twig loop grouping divs

Twig
I want to populate a twig page with information stored in the database. I use a loop to make multiple divs containing different entries of the same ta...
4 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 ...
4 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...
4 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...
4 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....
4 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>...
4 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...
4 months ago

Twig variables in twig variable

Twig
I have twig variable html. To show it in twig template I do {{html}}. That variable look like <div>{{region_top}}</div><div>{{regio...
5 months ago