Category : twig

After updating from Symfony 2.X to Symfony 4.4 and verifying the operation, I found that Twig does not recognize modal. Since it does not recognize modal, it will be displayed even when the code that is not displayed in modal in the if statement is displayed in modal. When I tried "if modal is empty", ..

Read more

I am trying to update Twig in Symfony 4 like this: composer require twig/twig The error message is: Your requirements could not be resolved to an installable set of packages. Problem 1 – twig/extensions is locked to version v1.5.4 and an update of this package was not requested. – twig/extensions v1.5.4 requires twig/twig ^1.27|^2.0 -> ..

Read more

I am having issues overriding a label in my form in my Symfony 4.4 application: {{ form_row(form.legal, { ‘label’ : ‘personal.form.fields.legal’|trans }) }} personal.form.fields.legal looks like this: I agree that I am 18 and above, I have read and accept the <a href="/terms-cond">T&Cs</a> My form definition: ->add(‘legal’, CheckboxType::class, ‘required’ => true, ‘mapped’ => false, ]) ..

Read more

well I want the readonly proprety to have a value depending on a variable. My idea is like this : sending the variable(which is a boolean) as a parameter when rendering. return $this->render(‘responsable/uneInscription.html.twig’, [ ‘form’ => $form->createView(), ‘readonly’ => $readonly, ]); and use the variable like this : {{ form_row(form.id_diplome.niveau, {‘attr’: {‘class’ : ‘form-control’ ,’readonly’: ..

Read more

I have this error, but I don’t know why, the code seems correct… templatesbase.html.twig <head> <meta charset="UTF-8"> <title> {% block title %}Welcome! {% endblock %} </title> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> <link href="{{ asset(‘css/star-rating.css’) }}" media="all" rel="stylesheet" type="text/css"/> {% block stylesheets %}{% endblock %} <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> <script src="{{ asset(‘js/star-rating.js’) }}" type="text/javascript"></script> </head> templatesproductindex.html.twig <script> jQuery(document).ready(function ..

Read more

Please help me figure it out. I’ve searched hundreds of articles and can’t figure it out. I connect the template in accordance with the documentation: return $this->render(‘LoginPassAuthBundle::login.html.twig’, [ ‘name’ => ‘auth’, ]); But I get the error Unable to find template "LoginPassAuthBundle::login.html.twig" (looked into: /var/www/html/templates). I’ve tried all sorts of different options, but I still ..

Read more