Zitat von
waldo
Wie würde denn die Vorgehensweise aussehen, wenn ich mein Bundle weiterhin in src/ zum laufen bekommen möchte?
Dann zB so:
composer.json
Code:
"autoload": {
"psr-4": {
"": "src/"
}
},
Code:
src/
FooBundle/
BackendModule/
ContentElement/
DataContainer/
FrontendModule/
Model/
Widget/
.../
Resources/
contao/
config/
dca/
languages/
FooBundle.php
ContaoManagerPlugin.php
ContaoManagerPlugin.php
PHP-Code:
<?php
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use FooBundle\FooBundle;
/**
* Plugin for the Contao Manager.
*/
class ContaoManagerPlugin implements BundlePluginInterface
{
/**
* {@inheritdoc}
*/
public function getBundles(ParserInterface $parser): array
{
return [
BundleConfig::create(FooBundle::class)
->setLoadAfter([
ContaoCoreBundle::class,
]),
];
}
}
Lesezeichen