Quite odd problem, sorry for asking, i'm quite new to Symfony/Twig. My route requires a mandatory region_id paramenter:  ajax_provinces_by_region:   pattern: /ajax/region/{region_id}/provinces   defaults: {_controller: SWAItaliaInCifreBundle:Ajax...
I have a view called contact.html.twig. It has a form with some textfields. I want to use javascript to validate that none of the fields are empty, as well as some other rules. But I do not know where to put the .js with the definitions. I do not kno...
I'm attempting to open up data from a PHP Object (as shown below) but I'd like to be able to access this data within JavaScript to use in a graphing library.  Object in question:    What I need to be able to do is convert that into a JSON enc...
Is it possible to get object from twig array knowing that the index is a javascript variable   Mycontroller  public function showContactModalAction($iduser, $profil) {     $em = $this->getDoctrine()->getEntityManager();     $contacts = $em->...
Is there a way to use Twig as an Assetic filter?  What I want to do is have Twig parse my JavaScript files as Twig templates, and then pass them to Assetic so that they get combined and minified in production.  You might be scratching your head think...
I would like to know how to pass javascript variables values from twig to controller using href path in Symfony2. this is my code:   <html> <head>     <script src="//code.jquery.com/jquery-1.11.1.min.js"></script> <...
The following code is in my Twig template and it's for load a CSS file or another depending on the theme selected by the user. This works perfectly on a simple HTML page but when I try to take this to the Twig template of my Symfony application I...
I would like to know how to display to a html twig form field value through javascript using an alert message in Symfony2. This is the form code:       <html>     <head>         <title> Wkayet </title>          <link rel=&#...
I just want to pass a javascript variable to a twig path. Now i'm using this, but it doesn't work.   <p id="result"></p> <script> var text = ""; var i; for (varJS = 0; varJS < 5; varJS++) {     text += ...
i have a problem in my twig view when i pass params in the ajax url path, logically twig is executed before javascript so he didnt recognize the input value passed as parameter. Is there a solution to do this without passing the param in data ?    &l...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.