One of the strong points in every framework is its coupling between its components. A tightly coupled framework does not allow the developer to replace framework components in an easy and clear way without any impacts on the working project. Phalcon offers the Phalcon\Di
component, which implements patterns such as Dependency Injection
and Service Locator, and is itself a container for dependencies. In this chapter, we will discover how to use the Phalcon\Di
component, and how to deal with dependencies in various places of your code.
One of the most powerful programming techniques is event driven programming. By using such an approach, executing the application or its separate parts is defined by events, for example, users clicking on the link, registration, and expiration of a session. Events allow you to solve many tasks, by dividing the application logic into listeners that serve different events. This development approach provides the developer with the power to manipulate...