M
M
magary42016-07-28 17:27:03
symfony
magary4, 2016-07-28 17:27:03

How to handle incoming parameters in a REST controller?

you need to make an ajax search on the site the
request comes to the REST controller, for the search there is a $searchService
how best to take all the incoming parameters and pass it to
$searchService->find(["q"=>"laptop", "price"=>100, "category"=>3])
what is the best way to apply ? form or serializer, or just loop through $request->all()?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shaqster, 2016-07-28
@magary4

FOSRestBundle + FOSJsRoutingBundle + ParamFetcher .
Minimum movement, maximum convenience

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question