Questions tagged as 'twig'

3
answers

How to pass variable from javascript to twig?

The following code is for me to load on the page a CSS or another depending on the chosen theme. This code works perfectly on page HTML pure, but when I try to take my application Symfony not found a way to pass the JS %%...
asked by 05.08.2016 / 17:34
1
answer

Relate twig template with php controller in symfony

I have a method in the controller used to change data in a table. public function bajaServicioAction($idservicio, $idcliente) { codigo para hacer el cambio en la base de datos } On the other hand I have a template ficha.html.twig...
asked by 12.03.2018 / 17:59
1
answer

Twig, Render duplicated if use includes in the template

I'm trying Twig (currently I'm noob in twig it's my first time). This is what I am doing: main.tpl <!DOCTYPE html> <html> {% include 'header.tpl' %} <body> {% include 'logo.tpl' %} content {% inc...
asked by 14.08.2016 / 07:42
1
answer

Error comparing two strings in an if in twig

I have an error comparing two strings in twig . Here is an example of my code: {% set var1 = "" %} {% set var2 = "" %} {% for unidad in array %} {% if unidad.var1 == var1 %} {% if unidad.var2 == var2 %}...
asked by 02.08.2016 / 09:18
1
answer

How can I connect a view and a controller [closed]

Context I'm learning symfony2 ?     
asked by 15.03.2016 / 09:29
1
answer

extends from twig

I am starting to use smfony and I have some doubts, I have the following base template: base.html.twig <!DOCTYPE html> <html> <head> {% block head %} <meta charset="UTF-8"> <l...
asked by 11.06.2018 / 01:57
1
answer

Problem with array and Twig symfony 2

I have a problem between the controller of an application and a template twig, what I do is to convert a field from one row of the database to UTF8 , and then send an array to the view and that field I get well formatted. Driver and twig code...
asked by 24.09.2016 / 22:45
1
answer

template twig header and footer always visible without using {% block [...]%}

I'm doing a website for me and I have a question about how to use the templates. That is, right now I use {% block [...] %} to add my header and footer to the pages. But I would like to make both header and footer always present on the pa...
asked by 01.07.2018 / 19:01
1
answer

Use Twig tags with React Js

I'm using Django that uses Twig to render the templates. What I want to do is put an item that Django uses in the React code as follows: var usuario = {{usuario}}; But he will not let me. There is not any kind of tag {verbatim} that canc...
asked by 24.11.2016 / 00:46
2
answers

AJAX response problem with Symfony2 (PHP)

I have a problem with the code: $cadenaScroll_respuesta.="<li> <div id='usuario-respond'><div id='imagen-usuario-respond' ><ul> <li id='nombreUsuario'> <b>".$respuesta->getUsuario()." </b></li>...
asked by 23.05.2016 / 20:48