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
All the information in EasyAdmin is passed via query parameters. The best way to get the value of these parameters is:
$value = $request->query->get('name');
But most of the time, because I'm lazy, I use the following:
$value = $request->get('name');
This works right, but it's a bit slower and it's not strictly correct in our case (we pass data in the query string, then we shouldn't look for in other parts of the request).
This PR was merged into the master branch.
Discussion
----------
explicitly use query parameters, fixes#20
Commits
-------
816a93f explicitly use query parameters, fixes#20
…iereguiluz)
This PR was squashed before being merged into the master branch (closes#546).
Discussion
----------
Improved the way associations are displayed/handled
This fixes#539 and any other issue related to associations with entities that don't define the usual `__toString()` method. This is the new behavior:
1) Common case: backend displays a link to the "show" view of the target entity.
2) If the target entity is not managed by EasyAdmin, its string representation is displayed without a link.
3) If it's a collection of values, we show the count of elements (as we do now).
The main change is in how we determine the string representation of an associated value:
1) If the target entity has a `__toString()` method, we display `(string) $value`
2) If the target entity has a `getId()` method, we display `Name_of_class #ID` (e.g. `Category #20`)
3) Otherwise, we display the name of the class (e.g. `User`)
Commits
-------
7be2b8b Improved the way associations are displayed/handled
All the information in EasyAdmin is passed via query parameters. The best way to get the value of these parameters is:
But most of the time, because I'm lazy, I use the following:
This works right, but it's a bit slower and it's not strictly correct in our case (we pass data in the query string, then we shouldn't look for in other parts of the request).
This improvement was suggested by @stof in javiereguiluz@f08250a#commitcomment-9312420
The text was updated successfully, but these errors were encountered: