https://github.com/contao/manager-plugin
Contao Manager Plugin
https://github.com/contao/manager-plugin
cms contao contao-manager php plugin
Last synced: 9 months ago
JSON representation
Contao Manager Plugin
- Host: GitHub
- URL: https://github.com/contao/manager-plugin
- Owner: contao
- License: lgpl-3.0
- Created: 2016-11-25T09:44:16.000Z (over 9 years ago)
- Default Branch: main
- Last Pushed: 2025-05-23T12:32:14.000Z (about 1 year ago)
- Last Synced: 2025-06-21T03:46:35.593Z (about 1 year ago)
- Topics: cms, contao, contao-manager, php, plugin
- Language: PHP
- Homepage:
- Size: 270 KB
- Stars: 5
- Watchers: 8
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Contao manager plugin
[](https://packagist.org/packages/contao/manager-plugin)
[](https://packagist.org/packages/contao/manager-plugin)
The Contao managed edition is a self-configuring application, which registers
bundles automatically based on their plugin class. The Contao manager bundle
is required to create this class.
## The plugin class
It is recommended to create the plugin in `src/ContaoManager/Plugin.php`.
```php
=3.0"
},
"extra": {
"contao-manager-plugin": "Vendor\\SomeBundle\\ContaoManager\\Plugin"
}
}
```
## Registering bundles
If your bundle uses other bundles, which are not yet registered in the kernel,
you can add them by implementing the `BundlePluginInterface` interface. The
following example registers the `KnpMenuBundle` class:
```php
load('@VendorSomeBundle/Resources/config/config.yml');
}
}
```
You can also add a configuration in a specific environment only:
```php
load(
function (ContainerBuilder $container) use ($loader) {
if ('dev' === $container->getParameter('kernel.environment')) {
$loader->load('@VendorSomeBundle/Resources/config/config_dev.yml');
}
}
);
}
}
```
This is the equivalent of adjusting the `app/config/config.yml` file of a
regular Symfony application.
## Adding custom routes
If your bundle adds custom routes to the Symfony router, you can implement the
`RoutingPluginInterface` interface.
```php
resolve($file)->load($file);
}
}
```
This is the equivalent of adjusting the `app/config/routing.yml` file of a
regular Symfony application.
## Loading dependencies
If your bundle depends on one or more other bundles to be loaded first, so it
can override certain parts of them, you can ensure that these bundles are
loaded first by implementing the `DependentPluginInterface`.
```php