A
A
Artemio Vegas2017-06-09 07:05:43
symfony
Artemio Vegas, 2017-06-09 07:05:43

Symfony how to filter data by get parameter value?

Hello everyone
. I'm doing a training project on Symfony, I ran into a problem how to correctly implement filtering data from the database, based on get parameters (let's say filtering the list of news by date).
While I want to implement without AJAX.
I read about Doctrine filters docs.doctrine-project.org/projects/doctrine-orm/en... it seems clear, but how to implement the logic in the controller?
That is, a request comes in, we get the get parameters, we pass the necessary parameters to a variable in the Doctrine filter, or is there a more elegant solution? Links to examples are welcome.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
voronkovich, 2017-06-09
@ArtemioVegas

Doctrine filters should not be used in this case. If the project is educational, you can see this pull request . There's just a "learning" implementation.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question