-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature #152 [WIP] Make config & entity handier (ogizanagi)
This PR was squashed before being merged into the master branch (closes #152). Discussion ---------- [WIP] Make config & entity handier Some times ago, someone (I think it was @Pierstoval ?) talked about the fact it was kind of boring to pass `entity` & easyadmin `config` to the twig render method everywhere. This is one of the feasible solutions, but not THE solution. In fact, I wasn't able to establish what would be the best option. And as I do not want to give too many clues at first, but instead have your homemade opinions & first thoughts about it, I'll stay fairly general and will only list some of the other solutions, without more explanations: - Declare **Twig_Globals** from the *Twig Extension* class - Declare **Twig_Globals** through the *twig configuration* in `config.yml` - Inject `entity` the same way `config` is currently injected in this PR (within a `kernel.request` listener) - Do not use **Twig_Globals**, but **Twig_Functions** instead - Simply inject both entity & config as **Twig_Globals** from `AdminController::initialize()` method There are many underlying questions behind each of those "solutions". So, what do you think ? 😕 Commits ------- 2db112b [WIP] Make config & entity handier
- Loading branch information
Showing
5 changed files
with
39 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters