{"id":28625261,"url":"https://github.com/contao/manager-plugin","last_synced_at":"2025-10-18T14:25:37.438Z","repository":{"id":13550975,"uuid":"74745464","full_name":"contao/manager-plugin","owner":"contao","description":"Contao Manager Plugin","archived":false,"fork":false,"pushed_at":"2025-05-23T12:32:14.000Z","size":276,"stargazers_count":5,"open_issues_count":1,"forks_count":9,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-06-21T03:46:35.593Z","etag":null,"topics":["cms","contao","contao-manager","php","plugin"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/contao.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"custom":"https://to.contao.org/donate"}},"created_at":"2016-11-25T09:44:16.000Z","updated_at":"2025-05-23T11:12:30.000Z","dependencies_parsed_at":"2024-06-18T18:35:15.380Z","dependency_job_id":"0022af27-be9b-4e83-af33-cfd30d748240","html_url":"https://github.com/contao/manager-plugin","commit_stats":{"total_commits":171,"total_committers":10,"mean_commits":17.1,"dds":"0.45029239766081874","last_synced_commit":"7771110f7d6f6a7ea3fec80dfe311dbf445f852b"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/contao/manager-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contao%2Fmanager-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contao%2Fmanager-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contao%2Fmanager-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contao%2Fmanager-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/contao","download_url":"https://codeload.github.com/contao/manager-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/contao%2Fmanager-plugin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265589559,"owners_count":23793565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cms","contao","contao-manager","php","plugin"],"created_at":"2025-06-12T08:08:55.031Z","updated_at":"2025-10-18T14:25:32.394Z","avatar_url":"https://github.com/contao.png","language":"PHP","funding_links":["https://to.contao.org/donate"],"categories":[],"sub_categories":[],"readme":"# Contao manager plugin\n\n[![](https://img.shields.io/packagist/v/contao/manager-plugin.svg?style=flat-square)](https://packagist.org/packages/contao/manager-plugin)\n[![](https://img.shields.io/packagist/dt/contao/manager-plugin.svg?style=flat-square)](https://packagist.org/packages/contao/manager-plugin)\n\nThe Contao managed edition is a self-configuring application, which registers\nbundles automatically based on their plugin class. The Contao manager bundle\nis required to create this class.  \n\n## The plugin class\n\nIt is recommended to create the plugin in `src/ContaoManager/Plugin.php`.\n\n```php\n\u003c?php\n\nnamespace Vendor\\SomeBundle\\ContaoManager;\n\nclass Plugin\n{\n}\n```\n\n## composer.json\n\nThe plugin class then needs to be registered in the `composer.json` extra\nsection. You also have to add a dev requirement and a conflict as shown below.\n\n```json\n{\n    \"require-dev\": {\n        \"contao/manager-plugin\": \"^2.0\"\n    },\n    \"conflict\": {\n        \"contao/manager-plugin\": \"\u003c2.0 || \u003e=3.0\"\n    },\n    \"extra\": {\n        \"contao-manager-plugin\": \"Vendor\\\\SomeBundle\\\\ContaoManager\\\\Plugin\"\n    }\n}\n```\n\n## Registering bundles\n\nIf your bundle uses other bundles, which are not yet registered in the kernel,\nyou can add them by implementing the `BundlePluginInterface` interface. The\nfollowing example registers the `KnpMenuBundle` class:\n\n```php\n\u003c?php\n\nnamespace Vendor\\SomeBundle\\ContaoManager;\n\nuse Contao\\ManagerPlugin\\Bundle\\Config\\BundleConfig;\nuse Contao\\ManagerPlugin\\Bundle\\BundlePluginInterface;\nuse Contao\\ManagerPlugin\\Bundle\\Parser\\ParserInterface;\nuse Knp\\Bundle\\MenuBundle\\KnpMenuBundle;\n\nclass Plugin implements BundlePluginInterface\n{\n    public function getBundles(ParserInterface $parser)\n    {\n        return [\n            BundleConfig::create(KnpMenuBundle::class),\n        ];\n    }\n}\n```\n\nThis is the equivalent of registering the `KnpMenuBundle` class in the\n`registerBundles()` method of the regular Symfony app kernel, except it is done\nautomatically as soon as your bundle is installed.\n\n## Configuring the container\n\nIf your bundle adds configuration options to the Symfony kernel or if you want\nto adjust the existing configuration, you can do so by implementing the\n`ConfigPluginInterface`.\n\n```php\n\u003c?php\n\nnamespace Vendor\\SomeBundle\\ContaoManager;\n\nuse Contao\\ManagerPlugin\\Config\\ConfigPluginInterface;\nuse Symfony\\Component\\Config\\Loader\\LoaderInterface;\n\nclass Plugin implements ConfigPluginInterface\n{\n    public function registerContainerConfiguration(LoaderInterface $loader, array $config)\n    {\n        $loader-\u003eload('@VendorSomeBundle/Resources/config/config.yml');\n    }\n}\n```\n\nYou can also add a configuration in a specific environment only:\n\n```php\n\u003c?php\n\nnamespace Vendor\\SomeBundle\\ContaoManager;\n\nuse Contao\\ManagerPlugin\\Config\\ConfigPluginInterface;\nuse Symfony\\Component\\Config\\Loader\\LoaderInterface;\nuse Symfony\\Component\\DependencyInjection\\ContainerBuilder;\n\nclass Plugin implements ConfigPluginInterface\n{\n    public function registerContainerConfiguration(LoaderInterface $loader, array $config)\n    {\n        $loader-\u003eload(\n            function (ContainerBuilder $container) use ($loader) {\n                if ('dev' === $container-\u003egetParameter('kernel.environment')) {\n                    $loader-\u003eload('@VendorSomeBundle/Resources/config/config_dev.yml');\n                }\n            }\n        );\n    }\n}\n```\n\nThis is the equivalent of adjusting the `app/config/config.yml` file of a\nregular Symfony application.\n\n## Adding custom routes\n\nIf your bundle adds custom routes to the Symfony router, you can implement the\n`RoutingPluginInterface` interface.\n\n```php\n\u003c?php\n\nnamespace Vendor\\SomeBundle\\ContaoManager;\n\nuse Contao\\ManagerPlugin\\Routing\\RoutingPluginInterface;\nuse Symfony\\Component\\Config\\Loader\\LoaderResolverInterface;\nuse Symfony\\Component\\HttpKernel\\KernelInterface;\n\nclass Plugin implements RoutingPluginInterface\n{\n    public function getRouteCollection(LoaderResolverInterface $resolver, KernelInterface $kernel)\n    {\n        $file = '@VendorSomeBundle/Resources/config/routing.yml';\n\n        return $resolver-\u003eresolve($file)-\u003eload($file);\n    }\n}\n```\n\nThis is the equivalent of adjusting the `app/config/routing.yml` file of a\nregular Symfony application.\n\n## Loading dependencies\n\nIf your bundle depends on one or more other bundles to be loaded first, so it\ncan override certain parts of them, you can ensure that these bundles are\nloaded first by implementing the `DependentPluginInterface`.\n\n```php\n\u003c?php\n\nnamespace Vendor\\SomeBundle\\ContaoManager;\n\nuse Contao\\ManagerPlugin\\Dependency\\DependentPluginInterface;\n\nclass Plugin implements DependentPluginInterface\n{\n    public function getPackageDependencies()\n    {\n        return ['contao/news-bundle'];\n    }\n}\n```\n\nThis is the equivalent of adding `requires[] = \"news\"` in the `autoload.ini`\nfile of a Contao 3 extension.\n\n## More information\n\nFor more information about the Contao managed edition, please read the\n[manual][1].\n\n[1]: https://docs.contao.org/dev/getting-started/initial-setup/managed-edition/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontao%2Fmanager-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcontao%2Fmanager-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcontao%2Fmanager-plugin/lists"}