For quick and dirty prototypes, you can get away with anonymous functions and using $app
as a service locator,
but this method can quickly lead to a messy project.
There are a few key points to developing a maintainable Nice application.
Early on, using closures for your actions is fast and simple. However, it can be very
beneficial to refactor your controller actions into distinct classes and register them as
services. Implement a custom route collector to improve the readability and re-usability
of your route mapping. Avoid relying on having the service container available
to get()
services; inject them properly instead.
Coming soon.
Powered by Codex 1.1.0