How to use and create plugins?
You can use as many plugins as you want.
Add the dependency with composer. Generally, the dependency can be found in the
composer.jsonfile in the theme repository.
Register theme in the
#config.yml engine: extensions: - Carew\Plugin\Toc\TocExtension
How to write a plugin#
The plugin must implements
Carew will call
ExtensionInterface::register and give itself
to the extension. So the plugin can alter everything.
The plugin can access to:
container, an instance of pimple.
event_dispatcher, an instance of Symfony EventDispatcher.
You can have a look to the
CoreExtension for more information.
Learn more about the carew architecture in the internal chapter.