Limit String Twig

Twig
How can I limit a string length? I'm getting a description value from my database, but I want to only display a number of specific characters. How ...
11 months ago

Symfony from styling time widgets

Twig
I am currently trying to style a form that is generated by symfony form builder. there is a bootstrap overlay on it but i want to move the time widg...
11 months ago

Making Twig filter to assign defaults unless otherwise specified

Twig
I'm trying to use twig as a template system for my website. I'm wanting to write something along the lines of... {{ title }} {% pageAuthor | Unknown ...
11 months ago

Twig: remove div around each checkbox fields of a form

Twig
Edit: see the solution I've found at the end of my question ;-) I'm looking since hours for a solution but I do not really find what I'like. I'm sur...
11 months ago

Twig doesn't render html tags, |raw doesn't work

Twig
I've got a simple blog application written in Symfony3, I'm using TinyMCE as a my text editor. I'm storing data in database, where example record loo...
11 months ago

Adding a property to an object in twig

Twig
I want to add property 2 to this object in twig object property1 According to this question Updating object properties in twig The accepted an...
11 months ago

Symfony translator and Twig

Twig
I have a templates library based on Twig, but I have not installed the whole Symfony library. I want to use Symfony's translation in my project, is th...
11 months ago

How to insert a Controller in Twig with "render" in Symfony 2.2?

Twig
I'm upgrading my project from Symfony 2.0.22 to 2.2.0 and review somes changes, but i'm blocked on this : I would like to render (like in Sf 2.0.X) a...
11 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...
11 months ago

Accessing session from TWIG template

Twig
I've searched a lot on the net how to access the global $_SESSION array from TWIG template and found this: {{app.session.get('index')}}, but when I'm ...
11 months ago

Using php code in .twig file slim framework

Twig
I am using Slim Framework for the first time and also using twig for templatizing. I have a land.twig file the contents of that file are <form ac...
11 months ago

How to handle twig view and bootstrap 3 rows/columns?

Twig
I have an Article entity and I made a findAll() in the controller. I rendered each article in a div with the col-md-6 class. But foreach 2 articles ...
11 months ago

Twig: in_array or similar possible within if statement?

Twig
I am using Twig as templating engine and I am really loving it. However, now I have run in a situation which definitely mustbe accomplishable in a sim...
11 months ago

Twig: {% block %} and extend

Twig
I am trying to override a {% block %} in a file (index.html.twig) that extends the file where the block is used (base.html.twig). But the extending fi...
11 months ago

Use filter inside another filter twig in symfony2

Twig
I need to know how can I get a filter from another filter, I have the next code. Maybe I have to use Twig_Enviroment, but I don't how. The Idea is: ...
11 months ago

symfony2.3 filter twig inside other filter

Twig
i have filter in twig : class AcmeExtension extends \Twig_Extension { public function getFilters() { return array( new \T...
11 months ago

In TWIG, is possible to get absolute url of a link with twig variables in it?

Twig
I have several URLs that look as follows: {{domainID}}/action/{{userId}}/anotherAction And the latter URL points to: http://localhost/viewA/{{domai...
11 months ago

twig nested loop getting more elements

Twig
I have a nested loop in twig and i get the elements doubled in the form of 1,1,1,1 / 2,2,2,2 / 3,3,3,3. How can i use the first loop to access the dat...
11 months ago

Twig - display template names if debug mode is enabled

Twig
I'm using Twig lately and I was wondering if it is possible to output the template names which are loaded on the page. The best way I can think of is ...
11 months ago

php namespace class not found - twig composer

Twig
I searched and tried all the answers and have had no success. I have a small MVC that was working just fine till I added namespaces. Errors everywher...
11 months ago