I’m doing a project for my courses on symfony, I use webpack and the “slidejs” library to make carousels. Everything works fine on the page where I use splide but on the other pages where it’s not used I get an error message in the console and all the rest of my javascript doesn’t work anymore Error: https://i.stack.imgur.com/x21fr.png I’m importing
Tag: symfony
symfony – key “id” for array with key “0,1,2,3,4,5,6” does not exist
I have an error in my symfony project: I no longer have an object from 0 to 6 in my database because I had to overwrite the data with make: auth, I believe for security I have new values but I don’t know what to do to avoid this error. I try to make the climbing sites of my database
Using webpack on a common Symfony Bundle
I have a “common” bundle that is used on several Symfony projects. This bundle contains the assets we use on our different projects (js and css). Until now this bundle was mainly adding assets with macros that allowed to load the libraries cdn. We use macros to load only the scripts we want for each page. We manage the dependencies
How can I use javascript code in an external file with twig elements?
I have a lot of javascript code one my twig template home.html.twig, for example: Because the source code of my main page is now full of javascript I try to move it into an external file, to have a more clean appearance: But it does not work because I have so much twig variables, and they are not recognized anymore.
Pass javascript variable to twig
I just want to pass a javascript variable to a twig path. Now i’m using this, but it doesn’t work. Answer Note You should really look at the FOSJsRoutingBundle.
how to keep double quotes in twig?
I have a json array that I pass to the twig template, but the double quotes in the array have been causing trouble, my json array is like this: in twig template, I print it out like this: I expect it to be attrs: [“a”, “b”], however, what gets output is attrs: ["a", "b"], I tried attrs: {{ arr|e(‘js’) }},
Ajax and Jquery in Symfony
I’m a beginner in Symfony (version 2), I have a project achieved with plain basic PHP, and now I’m redoing my pages in dealing with Symfony framework, and arrived to my jquery ajax functions, surely, things gonna be different, I used to do like this: Q: How to make that works on Symfony? What to put instead of targetFile.php? a