Most voted "twig" questions
Twig is a template system developed and used by the PHP Symfony2 framework.
Learn more…32 questions
Sort by count of
-
4
votes5
answers1944
viewsPHP MVC - Adding CSS, Images etc
Hello, in my application I am having problems when I will add a css file, image or any other file that is frontend, because when I will include I need to set the whole directory of the same, for…
-
4
votes1
answer82
views"Unexpected tag name" syntax error in Symfony2/Twig
My list has the code below: <h1>Posts</h1> {% for posts in post %} <article> <h2> {% post.titulo %} </h2> <div class="content"> {% post.conteudo %} </div>…
-
3
votes2
answers517
viewsFunction load() jQuery + Twig
I’m developing a system using PHP, with the idea of owning only one page. How? (I do not know if it is the best solution, I believe it is not) , I developed a side menu that is fixed and the…
-
2
votes1
answer252
viewsTwig and Namespaces
Hello, I’m having a hard time implementing the Twig in my project MVC, I’m using namespaces, autoloader all that stuff from PSR-0. I would like the hope of you to implement why I’m already freaking…
-
2
votes1
answer255
viewsView HTML with TWIG
I’m using TWIG in a project of mine but I’m not able to display a string that has Bold or Italic, it simply ignores. Other HTML commands are normally displayed. Example: {{ 'Ao…
-
2
votes1
answer224
viewsBetter performance/performance: Smarty, Twig or any other?
Although in general the systems of templates for PHP are used for other purposes, such as separating business rules, etc. Which one provides better performance for website loading/performance (or…
-
2
votes0
answers45
viewsWhy is my localhost adding an extra bar?
trait Pagination{ private $totalRegistros; private $limite; private $offset; private $totalPaginas; private $segmentoUrl; private $links; private $explodeBarrasUrl; private $posicaoPaginaUrl; static…
-
1
votes1
answer834
viewsHow to customize Symfony CRUD generated form?
I’m changing the Symfony template so that CRUD already has the format I need, I was able to change almost everything, but now I had the need to change the form, to edit the css classes and other…
-
1
votes0
answers37
viewsHow to access records of a CMS from a location above where it is installed?
I use the CMS Bolt and he uses the Twig, template engine. I need to access the created content, on a page above where the CMS is spinning. Ex: Bolt installed in the blog folder; page to access and…
-
1
votes0
answers256
viewsHow to access a Twig variable via Javascript?
I am creating an autocomplete to use in my system and I am using Twig... My script is very simple and with some searches on the internet, that’s what I got: <script type="text/javascript"> var…
-
1
votes1
answer200
viewsHow to put interest scheme in product listing?
There is a list of products in the layout I am doing with opencode. <div class="borderproduct" itemscope itemtype="http://schema.org/Product"> <a href="{{ product.link }}"…
-
1
votes0
answers135
viewsSelect2 displays value instead of text
I have some fields that use Select2 to make a basic CRUD, but consulting some fields from another base. The question is, when I click update, I put in an array all table values (dataTables) and then…
-
1
votes1
answer224
viewsError 500 when using Slim Framework with Twig
I’m developing a simple website, with Slim Framework and Twig for template engine, only that is returning the error 500 in the browser, this is the content of my file index.php (at the root of the…
-
1
votes0
answers75
viewsHow to render the contents of an array
In the application, there is a menu that is represented in PHP in the form of an array: $menu = [ ["title" => "Home", "path" => "/home", "children" => []], ["title" => "Secção", "path"…
-
1
votes1
answer61
viewsDoubt with Jquery and select
I am maintaining a code of another programmer and I am facing difficulties in two select. I need to take the time of each field and add up this interval, so far I’ve done some tests using the lib…
-
0
votes1
answer147
viewsHow to retrieve the contents of a rendered template in Symfony2 and store in a String
I’m using the Symfony2, I’m still getting familiar with this framework. And when using my controller I’m not sure how to pick up the output generated by it and play for a string. I need to play for…
-
0
votes1
answer201
viewsHow to work with I18N in PHP and Symfony?
There is an add-on to Symfony that allows you to work with i18n and . po and . mo or similar or is it really necessary to implement a solution for this? Ideally I could call the translation both on…
-
0
votes0
answers123
viewsHow to use_valuesin Twig
Personal peercebi that when I pass some variable with _ in the name in Twig it of the error causing me to remove _ from the variable name to work. How to hit you? Ex. in PHP $data_birthday in TWIG:…
twigasked 9 years, 9 months ago Joao Nivaldo 1,229 -
0
votes1
answer77
viewsHTML is not being displayed
I have a field in my table that records formatted text in HTML correctly. When I’m trying to display it on the screen, via TWIG using the filter RAW, it continues to be displayed as text and not as…
-
0
votes2
answers143
viewsHow can I apply a style only to one or the other <p>?
I have a problem that is apparently simple but because of my lack of experience I am getting screwed. The thing is, I’m doing a database listing of a text, and this text already comes with the tags…
-
0
votes1
answer256
viewsArray php go through
To the array: Array ( [45] => Array ( [car] => stdClass Object ( [consortiums] => stdClass Object ( ), [92] => Array ( [car] => stdClass Object ( [consortiums] => stdClass Object (…
-
0
votes2
answers692
views -
0
votes1
answer249
viewsPrint a session variable via the Twig engine
I entered a variable in the designated session $_SESSION['ano']. I would like to print your value on a page using Twig. I’ve tried to: {% for ano in app.session %} {{ ano }} {% endfor %} But it…
-
0
votes1
answer22
views -
0
votes1
answer78
viewsHow do I return the highest and lowest value within a loop by using Twig?
I make a list of some products and would need to return the largest and lowest value of products without using max and min in SQL query. I tried to use for example the function max() from Twig, but…
twigasked 9 years, 2 months ago Gabriel Schmidt Cordeiro 728 -
0
votes0
answers88
viewsInserting a responsive background image in html.Wig for Drupal 8
I’m trying to insert a image as responsive background in a html.Twig to the Drupal 8, but to no avail. I’m not finding a solution to this. Even better if it were something practical like a "put that…
-
0
votes1
answer121
viewsPrint 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"]=>…
-
0
votes3
answers139
views -
0
votes1
answer73
viewsHow to call a CODEIGNITER method in a TWIG view
Well I’m starting the journey in a project, offered by my School, to gain experience in the area of programming, I got in the middle of it, and I’m having some problems performing simple tasks. So…
-
0
votes1
answer282
viewsHow to import files from node_modules / folder into my view files?
I’m trying to learn some new technologies, so I decided to try npm, downloaded these packages (jquery and jquery-validation) using npm and now I’m trying to import these packages to my view file but…
-
0
votes1
answer47
viewsAsset function does not work on Symfony 5
I installed Symfony 5 using the command $ composer create-project symfony/website-skeleton my_project_name with the intention of obtaining the most complete possible package from Symfony. After…
-
-2
votes2
answers43
viewsTake a label by Parent() or id and replace
I have the following Opencart code snippet in Twig. {% for quote in shipping_method.quote %} <div class="radio"> <label id="{{quote.code}}"> {% if quote.code == code or not code %} {%…