Questions tagged as 'symfony2'

1
answer

Add value of a variable to a date

I am trying to add the value contained in a variable to a date, and that the result is another date. $hoy = $now->format('d/m/Y'); $dias = 36; $ newDate would be the result of adding to today's date the days that the variable contains. I...
asked by 25.04.2018 / 15:59
1
answer

How to get the current url in Twig in Symfony

I need to get the final route of the url in twig For example I have this url: http://www.hackeruna.com/pagina , I just need this part of the path /pagina .     
asked by 04.05.2018 / 00:42
0
answers

createQueryBuilder return a well-formatted JSON

Good, I have an action in my controller that what it does is collect the records of the entity Address and make a Join with the City entity to obtain the name of the city (City entity field name), for this I have this code that works but I retur...
asked by 02.02.2018 / 13:17
0
answers

Symfony, hide fields in a Type form

Good, I have an entity that is Users and another that is Cars, in the entities I have since 1 User can have N Cars, I have the relationship onetomany and manytoone respectively. Then I have created the type forms of both, where you can create...
asked by 03.02.2018 / 19:19
0
answers

Symfony2 Rest api, method PUT, request to null with multipart / form-data

link From what I have seen in the post that I left there is a bug in PHP that makes the request null with this type of content type, does anyone have a solution to pass files to a service rest with the method put? .I have solved it using po...
asked by 17.01.2018 / 10:57
3
answers

JMSSerializer Bundle does not serialize relationships

Controller: public function newUserAction(Request $request) { $errores = array(); $usuario = new Usuario(); $foto = $request->files->get('foto'); $email = $request->request->get('email'); $username = $request-&...
asked by 12.01.2018 / 10:14
1
answer

bootstrap-select multiple, validate if the option selected by the user is selected or not

What I'm looking for is that, when I click on one of the options of the select, it tells me if it is selected or it is not already selected, when I deselect an option of the three the following code tells me that if it is selected, but in...
asked by 02.01.2018 / 01:28
0
answers

Upload image to web folder in Symfony2

Hello, I am working on a project with Symfony2 and I have problems when uploading an image to the web folder of the project. With this I get the image from the html form: $file = $request->files->get('file'); this is the dir...
asked by 17.11.2017 / 04:19
1
answer

What actions should be implemented to improve security in Symfony?

I have developed an application in Symfony, with which I have no functional problems, more if in security according to some suggestions of infrastructure coordination. The point is that from the production server you can access the base direc...
asked by 10.11.2017 / 18:46
1
answer

Dinamic Roles in Symfony2

Good I have that piece of code, I have the class "Users" and the class "Roles", in this fragment the getRole () method, perfectly gets the user name of the class users, at this point return 'ROLE_' strtoupper ($ this-> user-> getUsername ());...
asked by 14.10.2017 / 07:42