Hier nochmals meine Konfiguration
PHP-Code:
# config/routes.yaml
Pbdkn\Efgco4\Controller: #????????? was ist hier der richtige Eintrag ??????????????????
resource: '../src/Controller'
type: annotation
mein Plugin
PHP-Code:
namespace Pbdkn\Efgco4\ContaoManager;
use Contao\CoreBundle\ContaoCoreBundle;
use Contao\ManagerPlugin\Bundle\BundlePluginInterface;
use Contao\ManagerPlugin\Bundle\Config\BundleConfig;
use Contao\ManagerPlugin\Bundle\Parser\ParserInterface;
use Oveleon\ContaoCookiebar\ContaoCookiebar;
use Contao\ManagerPlugin\Routing\RoutingPluginInterface;
use Symfony\Component\Config\Loader\LoaderResolverInterface;
use Symfony\Component\HttpKernel\KernelInterface;
use Pbdkn\Efgco4\PbdknContaoEfgco4Bundle;
class Plugin implements BundlePluginInterface
{
public function getBundles(ParserInterface $parser)
{
return [
BundleConfig::create(PbdknContaoEfgco4Bundle::class)
->setLoadAfter([ContaoCoreBundle::class])
->setReplace(['efg']), ];
}
public function getRouteCollection(LoaderResolverInterface $resolver, KernelInterface $kernel)
{
return $resolver
->resolve(__DIR__.'/../../config/routes.yaml')
->load(__DIR__.'/../../config/routes.yaml')
;
}
}
meine Autoload
'Pbdkn\\Efgco4\\ContaoManager\\Plugin' => __DIR__ . '/..' . '/pbd-kn/contao-efg-bundle/src/ContaoManager/Plugin.php',
'Pbdkn\\Efgco4\\Controller\\Ajax\\EfgRequestClass' => __DIR__ . '/..' . '/pbd-kn/contao-efg-bundle/src/Controller/Ajax/EfgRequestClass.php',
mein Controller
PHP-Code:
namespace Pbdkn\Efgco4\Controller\Ajax;
use Contao\ContentModel;
use Contao\CoreBundle\Framework\ContaoFramework;
use Contao\CoreBundle\InsertTag\InsertTagParser;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Contao\FilesModel;
use Contao\StringUtil;
use Contao\DcaUtil;
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\Exception as DoctrineDBALDriverException;
use Doctrine\DBAL\Exception as DoctrineDBALException;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Contracts\Translation\TranslatorInterface;
class EfgRequestClass extends AbstractController
{
private ContaoFramework $framework;
private Connection $connection;
private InsertTagParser $insertTagParser;
private TranslatorInterface $translator;
private CgiUtil $cgiUtil;
private EfgUtil $efgUtil;
public function __construct(
ContaoFramework $framework,
Connection $connection,
InsertTagParser $insertTagParser,
TranslatorInterface $translator,
CgiUtil $cgiUtil,
EfgUtil $efgUtil
)
{
$this->framework = $framework;
$this->connection = $connection;
$this->insertTagParser=$insertTagParser;
$this->translator=$translator;
$this->cgiUtil=$cgiUtil;
$this->efgUtil=$efgUtil;
//parent::__construct($strTable);
}
/**
* @throws \Exception
* @Route('/efg/reloadFiletree/{aktion}/{strtable}/{name}/{value}',
* name="EfgRequestClass::class\reloadFiletree",
* defaults={"_scope" = "frontend"})
*/
public function reloadFiletree(string $aktion, string $strtable, string $name,string $value)
{
return new Response('pbd reloadFiletree EfgRequestClass');
}
}
Danke für die Hilfe