Category : javascript

Im working on Symfony and try with google map api v3. I can view the route information between two points with the code below. I need to send each point on the route to a form under the route information. How can I do this? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> ..

Read more

I want to change the variable inside Twig by javascript, but there is an error: Variable "max" does not exist. my twig: {% block body %} <label for="maxN">Niveau MAX</label> <input type="number" id="maxN" class="form-control"> {{ form_label(form.ncUoCommandeUo) }} {{ form_widget(form.ncUoCommandeUo, {‘attr’:{‘min’:1, ‘max’: max}}) }} {% endblock %} {% block javascripts %} <script> my.ajax…… if (ncMaxUo.val() === 1) ..

Read more

I used the last answer from this question to Add Lines to my Poll which i am creating in Symfony but the string i am appending is a bit longer then the one in the answer (‘<div><input type="text" name="mytext[]"/><a href="#" class="delete">Delete</a></div>’) Mine looks like that (with twig, u don’t have to understand everything in there, ..

Read more

I have symfony project with twitter bootstrap template (hardcoded assets in twig). I would like manage assets with Encore, but if encore process file, make module and next compilation magic. Is any way how to config Encore for only combine js, without compilation? Basic install Encore: https://symfony.com/doc/current/frontend/encore/installation.html …and my idea, in file app.js: include ‘1-file.js’; ..

Read more

I’m having trouble setting up TailwindCSS with Symfony and I’m not sure what’s wrong webpack.config.js var Encore = require(‘@symfony/webpack-encore’); if (!Encore.isRuntimeEnvironmentConfigured()) { Encore.configureRuntimeEnvironment(process.env.NODE_ENV || ‘dev’); } Encore .setOutputPath(‘public/build/’) .setPublicPath(‘/build’) .addStyleEntry(‘tailwind’, ‘./assets/css/tailwind.css’) .enablePostCssLoader((options) => { options.config = { // directory where the postcss.config.js file is stored path: ‘./postcss.config.js’ }; }) .splitEntryChunks() .enableSingleRuntimeChunk() .cleanupOutputBeforeBuild() .enableBuildNotifications() .enableSourceMaps(!Encore.isProduction()) .enableVersioning(Encore.isProduction()) ..

Read more

I have a problem with NucleosAntiSpamBundle in my Symfony project. I installed it as described and I have something like this (just copied example from their github) while loading the web page: $form = $this->createForm(ContactType::class, null, array( ‘antispam_time’ => true, ‘antispam_time_min’ => 10, ‘antispam_time_max’ => 60, // Honeypot protection ‘antispam_honeypot’ => true, ‘antispam_honeypot_class’ => ‘hidden’, ..

Read more