Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How do you register a plugin? (for multi modules)

I want to share a beforeExecuteRoute for all the routes of my multi module app.

For that I wanted to have a plugin shared by all my modules which will be attached to 'dispatch' using the event manager. What I don't get is how I can register the plugin dir, just once. I found examples for single module app.



1.5k

create a loader.php in the same level as apps folder, and place the loading code there, and include that file in the bootstrap



1.4k

That loader will contain my plugin?

create a loader.php in the same level as apps folder, and place the loading code there, and include that file in the bootstrap



2.5k
Accepted
answer

no the loader will register your custom mades plugins and instantiate to the services or in your bootstrap file



1.4k

Thx it worked.

For the ones wondering, by loader they meant \Phalcon\Loader().

no the loader will register your custom mades plugins and instantiate to the services or in your bootstrap file