-1

After submit a GET form, The app works fine but I have this ugly URL :

http//mywebsite.local/page/240?appbundle_options%5Bstart%5D=25%2F09%2F2017&appbundle_options%5Bend%5D=30%2F09%2F2017&appbundle_options%5B_token%5D=_c2ZjonEHI3_1vLNcyp3xKRzcehqz02lguHgfx6Lzv8

I want to know if is it possible to "clean" that into (example)

http//mywebsite.local/page/240?start=15-08-2017&end=22-12-2018&token=abcdefgh123456789

it may be a simple dream but in case there is a clean and sensible method, I would like to know it, thank you

arno
  • 792
  • 14
  • 33
  • It is possible and you should not ask questions like "is it possible" on SO. – svgrafov Sep 11 '17 at 08:15
  • What have you tried and what is the problem? – svgrafov Sep 11 '17 at 08:16
  • So , how can I find if it is possible if I dont ask anywhere ? – arno Sep 11 '17 at 08:18
  • There might be a question and an answer on Meta about finding out if something is possible or not. If there, surprisingly, is no such question - ask it yourself. – svgrafov Sep 11 '17 at 08:27
  • Now about your task in hand. It consists of changing the redirect code so that it sent shorter parameters and changing the receiving code so that it accepted these shorter parameters. Now the task should be trivial, isn't it? If it is not, update the question with code and description of actual problem. – svgrafov Sep 11 '17 at 08:30
  • thank you but I wait more the opinion of someone who has already had the experience or has a relevant answer rather than a lot of unnecessary supositions that do not advance the issue. – arno Sep 11 '17 at 09:03
  • There is still no question to be answered, because your post contains no code. You should read my previous comment and add code if you want to resolve this problem. – svgrafov Sep 11 '17 at 09:07
  • Thank you for not feeling compelled to answer and flood of unnecessary comments if you do not understand that I am looking for a method and not a code. plz stop ;) – arno Sep 11 '17 at 09:14

1 Answers1

1

You can make the form action POST.

Or check the symfony routing documentation.

With the routing your url can look like this:

website.com/number/1/name/test

but with a get form this might become very long.

Keutelvocht
  • 670
  • 2
  • 10
  • 28
  • in fact, it is a form sent by POST that I was asked to modify in GET but personally these URLs disgust me. I think this stuff will stay like that for now ... ^^ – arno Sep 11 '17 at 09:47
  • 1
    You can always try to stash the form values in a session variable and redirect to another page so the url doesnt stay like that on screen. Or just do what you have to do with the form values and redirect to a success page. – Keutelvocht Sep 11 '17 at 10:28
  • for now I managed to clear up the URL a bit like this "public function getBlockPrefix() return null;" in my formType – arno Sep 11 '17 at 12:05