Questions tagged as 'twig'

1
answer

How do I return the largest and smallest value inside a for loop using Twig?

I make a listing of some products and would need to return the largest and smallest value of the products without using max and min in the SQL query. I've tried using Twig's max () function but it returns some errors. Here is what I did and th...
asked by 21.10.2015 / 14:16
1
answer

Array php loop [closed]

For the array: Array ( [45] => Array ( [car] => stdClass Object ( [consortiums] => stdClass Object ( ), [92] => Array ( [ca...
asked by 18.06.2015 / 15:37
2
answers

How can I do to apply a style only to one or another p?

I have a problem that is apparently simple but because of my lack of experience I'm getting screwed. It's the following, I'm doing a database listing of a text, and this text already comes with the <p></p> tags together. This...
asked by 06.05.2015 / 14:57
1
answer

How to retrieve the contents of a rendered template in Symfony2 and store it in a String

I'm using Symfony2 , I'm still getting familiar with this framework. And while using my control I'm not sure how to get the output generated by it and play to a string. I need to play to a string to handle, as I'm using pjax and if the reques...
asked by 26.07.2014 / 19:18
1
answer

How to work with I18N in PHP and Symfony?

Is there an add-on for Symfony that allows working with i18n and .po and .mo files, or is it really necessary to implement a solution for this? Ideally, I could call the translation in both the twig and the Controller. If there is any or what th...
asked by 30.07.2014 / 23:09
0
answers

Variables for extension of twig blocks

Hello I'm starting to adopt the MVC framework in my PHP projects and for this, I'm using Twig, so I understand I can not call more than one view at a time, so I call a view from the requested controller and it extends the others, just use the...
asked by 24.11.2018 / 19:19
0
answers

Search - OpenCart

I need to call the search.twig file inside the menu as in this photo ButwhenIcall{{search}}insidethemenu.twigfileIdonothaveanykindofresults,Itriedtogetthecontentsofthesearch.twigfileandputitinsidethemenu.twiguntilthesearchfieldappears,butwhenIt...
asked by 22.10.2018 / 20:36
0
answers

DomPdf does not recognize Bootstrap classes

I'm trying to generate a pdf file from an html / twig file. When you write echo in the variable that contains the html, it is correctly formatted, but when you call DomPdf it gets lost, and can not find the classes, so the pdf is broken. Some...
asked by 17.09.2018 / 20:18
0
answers

How to insert a navbar include in the Twig layout

What is the correct way to include a navbar include in the main page, Twig? I created the layout.twig where you are rendering the div container correctly: <div class="container"> {% block content %}{% endblock %} </div> I...
asked by 05.09.2018 / 16:08
1
answer

Print array on Twig

I have an array with the following structure: array(20) { [0]=> array(13) { ["id_question"]=> string(10) "1312352154" ["date_created"]=> string(19) "2018-06-20 18:08:38" ["anuncio"]=> string(12) "XXXXX"...
asked by 21.06.2018 / 22:20