I am working on a search form which will be querying a database for product details. For each query, I want to show the params in the URL. I don't know how to do it in Symfony2, in plain old PHP I could just use method="get"
for this. The problem here is, I need a refreshable and shareable URL for the queries. Please note, paginating should also be possible. I was thinking about something like this: `mydomain.com/3/?query=t-shirt+XL+red
EDIT
My Controller
$form = $this->createForm(new SearchType());
My FormType (SearchType)
$builder
->setMethod('GET')
->add('query', 'text')
->add('save' , 'submit')
->getForm();
The code above does almost what I want. It generates a "GET"-URL like:
search?query=hakro&save=&_token=KgCx2xOEphSMcIXr7OyFjkG87W6xizsaXT-0WLeUch0
But I don't want "save" and "token" parameters. How do I get rid of them?