Closed butschster closed 1 year ago
You don't need to merge the PR, it's just an example
@butschster
First of all, I don't understand the reason of using string nameslike 'schranz_templating.renderer.smarty' for container aliases.
I'm coming from a Symfony background where this is best practice for modules. The background there is that usage of a specific name avoids that a project accidentally overwrites a modules/bundle service, and defines more Interface more defines the public API.
But if you say that is not common in spiral I will definitely go the Spiral way here and avoid naming the services specific to the module.
When you bind closures into container you can request dependencies as function arguments. You don't need request container and then get dependencies from them.
Spiral framework Bootloader can automatically load depended bootloaders before loading current.
Thats are two really nice feature 👍
I could not push in your branch so I continued the changes here: https://github.com/schranz-templating/templating/pull/59
Thank you for this PR!
Hi @alexander-schranz
I've tried to refactor some of Bootloaders for Spiral Framework. I tried to show you how it could be if I did it.
First of all, I don't understand the reason of using string nameslike
'schranz_templating.renderer.smarty'
for container aliases. Why don't you use class names or interfaces?When you bind closures into container you can request dependencies as function arguments. You don't need request container and then get dependencies from them.
Spiral framework Bootloader can automatically load depended bootloaders before loading current.