How to use and create plugins?

Existing Plugins#


You can use as many plugins as you want.

  1. Add the dependency with composer. Generally, the dependency can be found in the composer.json file in the theme repository.

  2. Register theme in the config.yml file:

            - Carew\Plugin\Toc\TocExtension

That's it.

How to write a plugin#

The plugin must implements Carew\ExtensionInterface.

Carew will call ExtensionInterface::register and give itself to the extension. So the plugin can alter everything.

The plugin can access to:

You can have a look to the CoreExtension for more information.

Learn more about the carew architecture in the internal chapter.

You have created a plugin#

You have created a plugin and you want to share it? Write me an email and I will create a new repository on github/carew for you, or send me a pull request and add a new link.