We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
See contao/contao#7817
The text was updated successfully, but these errors were encountered:
Create a backend login listener:
# src/EventListener/Menu/AcmeBackendLoginListener.php <?php declare(strict_types=1); namespace App\EventListener\Menu; use Contao\CoreBundle\Event\MenuEvent; use Symfony\Component\EventDispatcher\Attribute\AsEventListener; use Symfony\Component\Routing\RouterInterface; use Symfony\Contracts\Translation\TranslatorInterface; #[AsEventListener] class AcmeBackendLoginListener { public function __construct( private readonly TranslatorInterface $translator, private readonly RouterInterface $router, ) { } public function __invoke(MenuEvent $event): void { $tree = $event->getTree(); if ('loginMenu' !== $tree->getName()) { return; } $acme = $event->getFactory() ->createItem('acme') ->setAttribute('class', 'acme') ->setLabel('Login with Acme') ->setUri('https://login.acme') ->setLinkAttribute('class', 'tl_submit has-icon') ->setExtra('icon', '/path/to/icon.svg') ->setExtra('icon_dark', '/path/to/icon--dark.svg') ->setExtra('safe_label', true) ->setExtra('translation_domain', false) ; $tree->addChild($acme); } }
Sorry, something went wrong.
No branches or pull requests
See contao/contao#7817
The text was updated successfully, but these errors were encountered: