I have searched the classes \Phalcon\Mvc\Controller & \Phalcon\DI\Injectable, but cannot understand where the filter attribute comes from.
If in the controller I use
$this->filter
where does it come from? The interfaces do not reflect this attribute anywhere.
Thanks
Related to (https://stackoverflow.com/questions/13303141/controllers-attr-this-filter-where-from) which was unfortunately closed due to the original poster’s English.
In the Phalcon Dependency Injection (
\Phalcon\DI) container, services are registered and interact with one another.The
\Phalcon\Mvc\Controllerautomatically allows access to the services registered in the DI container with the use of magic methods.So imagine you have registered a
filterservice in your DI container:This service is now available in your controller with the following ways:
or
The same goes for anything that has been stored in the DI container.