skip to Main Content

How to get to attribute value of twig variable using jquery

I have the following problem <a href='#' data-entry-id='{{ income.incSum }}' id='some_link_1'></a> const $entryElements = $('[data-entry-id]'); const $entryIds = $.map($entryElements, item => $(item).data('entryId')); console.log("entry ids ", $entryIds); If the data-entry-id attribute is in square brackets, everything works, the values are displayed.…

VIEW QUESTION

Php – Undefined Twig Filter

I'm using Twig in a standalone PHP app. So my composer only has this requirement: "twig/twig": "^3.6". I initialize twig, and then add custom filter like so: $loader = new TwigLoaderFilesystemLoader('templates'); $twig = new TwigEnvironment($loader, [ 'cache' => 'tmp/cache', ]);…

VIEW QUESTION

Php – ChoiceType of Forms

I have a Symfony app with this form: $builder->add('test', ChoiceType::class, [ 'choices' => ['a' => 1, 'b' => 2], 'multiple' => false, 'mapped' => false, 'expanded' => true, ]); I display it with {{ form_widget(form.test) }} and I get :…

VIEW QUESTION
Back To Top
Search