Skip to content
Advertisement

Tag: symfony

Symfony get connected user id from entity

In a Symfony2.8/Doctrine2 application, I need to store in each row of my SQL tables the id of the user who created or updated the row (users can connect with Ldap). So all my entities inherited of a GenericEntity which contains this variable (type would be string if I want to store Ldap username): And I use the prePersistCallback() to

500 status code for symfony functional test

I’m performing a test just to see if a certain route is working. The page/route is found at http://localhost/login and when I go there in the browser it works fine and I’ve tested this with no cookies and my cache cleared. However, as soon as I test it in the phpunit LoginControllerTest class I recieve a 500 status code internal

Symfony: pass parameter to Ajax url

I am trying to figure out how to enable/disable user with checkbox without page reload. index.html.twig UserController Question How can I set corresponding user id to enabledChange function and change checked state depending on user state? Answer You need to add quotes to your variables, and pass changePath as an argument: then: I hope this will help.

Rendering multiple forms on same page with Symfony 3

I’d like to show a login and a registration form on the same page. However it seems that we cannot render the same template with different form variables in different two actions in a controller. Here is what I mean; } Above I have my login and registration action. I’d like to pass the ‘form’ variable to the same twig

How to render json into a twig in Symfony2

The question is how to pass a json to twig to render a template. I’ve tried to pass a json with JsonResponse object but I did not find the way to render the template. TarifasController.php index.html.twig How can I pass a json from the controller to use it in the DataTable (in twig template) but mantaining the render in this

Advertisement