This recipe describes how to create your own components that extend Phalcon classes, which are Dispatcher
, Router
, Mvc\Application
, Mvc\Model
, and so on. So you can easily modify the behavior of any Phalcon component.
In this recipe, we will expand the features of the Phalcon framework by adding some optional layers between your main application and the framework. Our task is to avoid overwriting the main framework classes or extending them by means of inheritance, and to add the previously mentioned features by using a middleware. At the beginning we need to have a fully operational application to implement this recipe successfully. It will be enough to have any base application.
After that, we will check out a set of typical tasks and their potential solutions.