Ich muss hier leider nochmal um Rat fragen.
Ich entwickle parallel noch ein wiederverwendbares, lokales Bundle. Hier möchte ich gerade ein Frontend-Modul erstellen.
Ich habe folgendes erstellt:
composer.json meiner Contao Installation:
PHP-Code:
{
{
"type": "project",
"require": {
"contao/conflicts": "*@dev",
"contao/manager-bundle": "4.10.*",
"contao/news-bundle": "4.10.*",
"vendorname/contao-helpdesk-bundle": "dev-master"
},
"extra": {
"contao-component-dir": "assets"
},
"scripts": {
"post-install-cmd": [
"Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
],
"post-update-cmd": [
"Contao\\ManagerBundle\\Composer\\ScriptHandler::initializeApplication"
]
},
"repositories": [
{
"type": "path",
"url": "dev"
}
]
}
composer.json meines Bundles in: /dev/composer.json
PHP-Code:
{
"name": "vendorname/contao-helpdesk-bundle",
"description": "...",
"type": "contao-bundle",
"require": {
"contao/core-bundle": "^4.4"
},
"license": "proprietary",
"authors": [
{
"name": "Vendor",
"homepage": "https://www.vendor.de"
}
],
"autoload": {
"psr-4": {
"vendorname\\ContaoHelpdeskBundle\\": "src/"
}
},
"extra": {
"contao-manager-plugin": "vendorname\\ContaoHelpdeskBundle\\ContaoManager\\Plugin"
}
}
/dev/Controller/FrontendModule.php
PHP-Code:
<?php
namespace vendorname\ContaoHelpdeskBundle\FrontendModule;
use Contao\CoreBundle\Controller\FrontendModule\AbstractFrontendModuleController;
use Contao\CoreBundle\Exception\RedirectResponseException;
use Contao\CoreBundle\ServiceAnnotation\FrontendModule;
use Contao\ModuleModel;
use Contao\PageModel;
use Contao\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
/**
* @FrontendModule(category="miscellaneous")
*/
class HelpdeskModuleController extends AbstractFrontendModuleController
{
protected function getResponse(Template $template, ModuleModel $model, Request $request): ?Response
{
return $template->getResponse();
}
}
/dev/src/Resources/contao/dca/tl_module.php
PHP-Code:
<?php
$GLOBALS['TL_DCA']['tl_module']['palettes']['helpdesk_module'] = '{title_legend},name,type;{template_legend:hide},customTpl;';
/dev/src/Resources/contao/templates/mod_helpdesk_module.html5
HTML-Code:
<div class="my-frontend-module">
<h1>FRONTEND MODULE</h1>
</div>
So habe ich es zumindest als Vorgehensweise in der Dokumentation verstanden.Das Frontendmodul wird mir jedoch nicht angezeigt.
Der Composer Installer läuft ohne Fehlermeldung durch, zeigt mir zusätzlich aber noch folgendes an:
PHP-Code:
Deprecation Notice: Class vendorname\ContaoHelpdeskBundle\FrontendModule\HelpdeskModuleController located in ./vendor/vendorname/contao-helpdesk-bundle/src/Controller/FrontendModule/HelpdeskModuleController.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///var/www/vhosts/.../web/contao-manager.phar.php/vendor/composer/composer/src/Composer/Autoload/ClassMapGenerator.php:201
Lesezeichen