FAQ Database Discussion Community


Get value from URL in Javascript|jQuery and Symfony2 project

javascript,php,jquery,symfony2,symfony-routing
I need to get some parameters from URL using Javascript/jQuery and I found this nice function: function getURLParameter(sParam) { var sPageURL = window.location.search.substring(1), sURLVariables = sPageURL.split('&'); for (var i = 0; i < sURLVariables.length; i++) { var sParameterName = sURLVariables[i].split('='); if (sParameterName[0] == sParam) { return sParameterName[1]; } } };...

Route names starting with underscore in Symfony2

symfony2,symfony-routing
I'm working on a Symfony2 project and in the file routing.yml I have the following lines: _front: resource: routing_front.yml _admin: resource: routing_admin.yml prefix: /admin So this actually allows defining the routes for the front-end and the back-end in separate dedicated files. What about the names though ? Is it simply...

Circular reference detected in routing_dev.yml

php,symfony2,fosrestbundle,symfony-routing,nelmio-api-doc
I'm getting crazy with this circular reference issue and I can't find what I'm doing wrong. This is the content of /app/config/routing.yml: pd_one: resource: "@PDOneBundle/Controller/" type: annotation prefix: / template: resource: "@TemplateBundle/Controller/" type: annotation prefix: / fos_user: prefix: /admin resource: "@FOSUserBundle/Resources/config/routing/all.xml" restful_services: resource: "@PDOneBundle/Resources/config/routing.yml" type: rest prefix: /api nelmio_apidoc: resource:...

Where should I put Symfony third-party bundle's routing configuration?

php,symfony2,routing,symfony-routing
I have SonataAdminBundle, SonataUserBundle and LiipImagineBundle installed in my Symfony 2 application. According to their installation instruction, I put their routing configuration in /app/config/routing.yml. _liip_imagine: resource: "@LiipImagineBundle/Resources/config/routing.xml" admin: resource: "@SonataAdminBundle/Resources/config/routing/sonata_admin.xml" prefix: /admin _sonata_admin: resource: . type: sonata_admin prefix: /admin sonata_user: resource: '@SonataUserBundle/Resources/config/routing/admin_security.xml' prefix: /admin...

Doubts around Symfony2 Routing component usage

php,symfony2,fosrestbundle,symfony-routing
I'm setting up FOSRestBundle and have some doubts, don't know if related to Symfony2 Routing component or can be done in any other way. Here, 1) How do I check if X-PDONE-SESSION-ID is set on request headers before execute the method? Can this be done using annotations on routing? Any...

Symfony2 wildcard routing

php,symfony2,twig,symfony-routing
I'm trying to create a special route that handles confirmation of a certain action. For instance, if I'm trying to access a route /admin/user/1/delete, I want to go to a different route first to show a special html page that confirms they want to complete an action (ie. confirm/admin/user/1/delete) and...