You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Our current implementation is relying on Symfony Request object to retrieve parameters (for sorting and/or filtering). Basically, we simply use $request->query for an almost-direct access to query string parameters (being $request->query basically a wrapper around $_GET).
The main problem of this direct approach is that it's impossible for the developer to add a custom layer, so in the end the variables are exposed to end-users (think, for example, to database field names). See for example KnpLabs/KnpPaginatorBundle#728
My idea is to add an interface to abstract parameter retrieving, and inject it everywhere we inject the Request object, as an optional second argument. An internal implementation of such interface can rely on Request object, being super simple.
In an eventual release, we can deprecate the direct using of Request, making the first argument nullable.
Eventually, in a major release, we'll drop the Request injection and rely only on the new interface.
Our current implementation is relying on Symfony Request object to retrieve parameters (for sorting and/or filtering). Basically, we simply use
$request->query
for an almost-direct access to query string parameters (being$request->query
basically a wrapper around$_GET
).The main problem of this direct approach is that it's impossible for the developer to add a custom layer, so in the end the variables are exposed to end-users (think, for example, to database field names). See for example KnpLabs/KnpPaginatorBundle#728
My idea is to add an interface to abstract parameter retrieving, and inject it everywhere we inject the Request object, as an optional second argument. An internal implementation of such interface can rely on Request object, being super simple.
In an eventual release, we can deprecate the direct using of Request, making the first argument nullable.
Eventually, in a major release, we'll drop the Request injection and rely only on the new interface.
What do you think?
@polc @julienmiclo @pyatnitsev @ThauEx @javer
The text was updated successfully, but these errors were encountered: