Questions tagged as 'twig'

5
answers

Disable / Enable according to a JAVASCRIPT data

I have a problem with this function, I do not really understand why it does not work for me, it consists of the following. I have a .twig done in symfony. In it I have a list of details of a particular book. What I want to do through Javascri...
asked by 26.05.2018 / 13:30
2
answers

Roles in symfony

I have several roles set in Symfony hierarchically ROLE_1: [ROLE_2] ROLE_2: [ROLE_3, ROLE_4] ROLE_3: [ROLE_4] ROLE_4: [ROLE_4] in a twig I need to execute an action strictly for t...
asked by 16.06.2017 / 17:07
1
answer

assign a Twig global variable

Hi, I'm learning to use twig, and I can not assign a variable to use in all the templates, in the documentation it says $twig = new Twig_Environment($loader); $twig->addGlobal('text', new Text()); and I use it like that $twig = new Twi...
asked by 07.03.2017 / 07:15
1
answer

how to put a custom id to the helper form_start

I'm doing a project in Symfony 2.6 and I need to put the value of id to helper form_start , which only shows the default name . >     
asked by 28.08.2016 / 20:55
4
answers

Error extracting database text

With native php I extract from a database a text that contains the typical text, images, videos etc. I'm migrating the web and I'm using Symfony 2 The content for example of a field in the database is as follows: <p style="text-alig...
asked by 20.10.2016 / 14:12
1
answer

Bolt cms doubles my path when I call my css and my js

I am using Bolt CMS in one of my pages and when including my style files or my javascript there is a part of the link that is duplicated, then it does not find the files. In Bolt Symfony is used so I include them w...
asked by 30.11.2016 / 15:16
0
answers

how do you put the class to the easyadmin form row in symfony 3?

I have a question about the easyadmin twig and the customization of the properties when a form is made with the builder. I have this in the easyadmin configurator: easy_admin: entities: Matriculasinconfirmar:...
asked by 27.12.2018 / 11:13
1
answer

as I can if a condition is not met redirect

It is possible to perform a redirection with the template engine of twig I need to validate using a variable that I have, if the variable is not fulfilled redirect to /account/login {% account.islogin==false%} {#redireccion /acc...
asked by 03.01.2019 / 20:32
2
answers

Problem with the use of symfony path in jquery ajax call

I am developing a web system with Symfony 3.4. I have a function that must execute an ajax call to a controller and use the jquery function for that purpose. I'm having problems using the {{path ('')}} in the url The ajax call is the following...
asked by 11.10.2018 / 18:30
0
answers

Pass variable from js to twig

I am trying to pass a variable from js to twig in the following way: <script> $('.li').on('click', function(){ var that = parseInt($(this).attr("id")); confirm("Estas seguro?, OK para continuar.", function(){ document.location...
asked by 06.08.2018 / 21:12