I’m working with Symfony 2 and need some advice.
I have a Controller, which gets a form-request and searches the database for matches and renders the results (so it’s just a basic search).
Now I would like to redirect to this controller but without coming from a form.
To be more specific:
- I’m on the search-page, fill out the form and hit the search button -> I get results for my search.
- I’m somewhere else and want to delete a labelCategory of a book -> If some books still use this labelCategory, I want to get search results for this labelCategory.
My only idea so far is, to simulate the form submit somehow, but I didn’t find out how to do it.
I’d be happy for every help of you 😉
You don’t need form submit at all. Just put logic of searching to separate class. Than you can it in any controller you want. Maybe Service Container doc can help to