We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

WHY Plugins should not extend the class Phalcon\Mvc\User\Plugin?

Why

"Plugins should not extend the class Phalcon\Mvc\User\Plugin, but by doing it they gain easier access to the services in the application."

How to write plugins if not User\Plugin or User\Components?

Better to use Phalcon\DI\Injectable ?

Hi, Anybody knows why Phalcon\Mvc\User\Plugins should't be used to create plugins? Which class should be base for user plugin or extension in application?



98.9k

Phalcon\Mvc\User\Plugin is recommended to be used in plugins and Phalcon\Mvc\User\Component in user components, both of them extend from Phalcon\DI\Injectable. Currently, those classes do not provide any additional method, but in the future, specific functionality could be added to those classes and your code would not need drastic changes/migrations.

So i think that in docs there is typo mistake, there are "Plugins should not extend"



98.9k

Ok, that's now fixed in the 1.0.0 docs, thanks