How to serve same functionality with different layouts in a Symfony2 app?

Twig
I have in a Symfony2 application the following bundle architecture: CommonBundle FirstBundle SecondBundle Several features are implemented in the ...
1 month ago

Twig if statement not including escaped code

Twig
I'm using Twig in Symfony3 and in my view I have an if statement. The html isn't rendered but the escaped twig does get rendered. Here's my code: {%...
1 month ago

How to make one Twig macro template inherit another and be able to use macros in same namespace?

Twig
Suppose I have two Twig templates containing just macros: <!-- macros_a.html.twig --> {% macro help_icon(msg) -%} <i class="glyphicon g...
1 month ago

Displaying Wordpress custom post type by first letter with Timber (twig)

Twig
I use Timber for Wordpress and I would like to create a dictionary system like that : http://wordpress.stackexchange.com/questions/119163/displaying-c...
1 month ago

How to make Twig ignore curly braces meant for Polymer?

Twig
I am trying to use Polymer in a Twig template. But I am facing this issue when binding the data. I am not able to use {{ }}, because Twig considers th...
1 month ago

Twig Symfony2 get Request variable

Twig
I know I can do this: app.request.get('name') ...but how do I do this? app.request.get(twig_var_name) I've tried every obvious solution {{}} () ...
1 month ago

Twig get an option in url

Twig
in a form i would like modify my url when i change my select option. When i do this, i have this in my url : ?extension-filter=&extension-list=10...
1 month ago

Symfony Twig and xml - Document is empty error

Twig
since the declaring of xml should happen in the first line and an empty line being added to the beginning of the rendered file which causing this erro...
1 month ago

How to set ids and names values?

Twig
I make a dynamic form but when i insert fields dynamically,names and ids not changed properly. Here is my code: <div id="dataRows"> <div cl...
1 month ago

For in twig with include

Twig
I need do a cycle for with an include directive in twig but the template twig will not repeat. This is a snippet of my code: ... {% for object in obj...
1 month ago

Twig templating conditional pattern loop

Twig
I have a feeling that this will be a very simple solution but I just can't wrap my head around it right now. I'm building a Craft CMS template with Tw...
1 month ago

How to get an image srcset inside page.html.twig in Drupal 8?

Twig
I've figured out how to get the image link: {{ node.myfieldname.entity.uri.value }} I've been poking around with kint for a bit now, but can't figu...
1 month ago

Twig_Error_Loader directory does not exist

Twig
I want to change render path of twig. I am using twig with codeigniter. my code is below: $loader = new Twig_Loader_Filesystem(FCPATH.'themes/site/de...
1 month ago

How to set variable, increment and echo it in Twig File?

Twig
I need to set incremented variable in foreach loop. and set incremented variable value as name of my text field, but I've got this error: Unexpect...
1 month ago

How to Use Multiple Role's In twig (Symfony2)

Twig
I am having these 3 role's 1. ROLE_ADMIN 2. ROLE_SAMPLE 3. ROLE_USER This My twig file {% if is_granted('ROLE_ADMIN') %} <a href="...">...
1 month ago

Set twig variable from javaScript

Twig
I need to generate url to be able to load some content in html element. $('#editSchool').click(function () { var id = $(this).attr('data-...
1 month ago

Get blog post from postlist array october cms?

Twig
I am creating a blog page, the post list page is in the form of different sized images. I need to be able to style each post list item individually so...
1 month ago

Twig add space at camel case letter

Twig
Is there a way in Twig to add a space where the word has camel case letters. For instance: helloWorldHowAreYouDoing would be hello World How Are ...
1 month ago

Symfony the same variable for all Twig templates

Twig
I am writing my own CMS using Symfony 3 right now and i have problem with include the same variables in all controllers. For example: I want render ...
1 month ago

Symfony2, Twig, if conditions to find current route for tab highlights

Twig
I am trying to get a list to highlight if it is at its current page (route). However, I also have subpages within the pages of which I also want the l...
1 month ago