Skip to content

Commit

Permalink
Use Hook annotation
Browse files Browse the repository at this point in the history
  • Loading branch information
bytehead committed Jan 3, 2022
1 parent f6b8d50 commit b638dd2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
namespace Contao\CoreBundle\EventListener\DataContainer;

use Contao\CoreBundle\Routing\ScopeMatcher;
use Contao\CoreBundle\ServiceAnnotation\Hook;
use Contao\DataContainer;
use Contao\Image;
use Contao\StringUtil;
Expand Down Expand Up @@ -41,6 +42,9 @@ public function __construct(Connection $connection, TranslatorInterface $transla
$this->csrfTokenName = $csrfTokenName;
}

/**
* @Hook("loadDataContainer")
*/
public function onLoadDataContainer(string $table): void
{
/** @var Request $request */
Expand Down
13 changes: 0 additions & 13 deletions core-bundle/src/Resources/config/listener.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,6 @@ services:
arguments:
- '@database_connection'

contao.listener.data_container.root_page_dependent_module:
class: Contao\CoreBundle\EventListener\DataContainer\RootPageDependentModuleListener
public: true
arguments:
- '@database_connection'
- '@translator'
- '@contao.routing.scope_matcher'
- '@request_stack'
- '@Contao\CoreBundle\Csrf\ContaoCsrfTokenManager'
- '%contao.csrf_token_name%'
tags:
- { name: contao.hook, hook: loadDataContainer }

contao.listener.data_container.theme_templates:
class: Contao\CoreBundle\EventListener\DataContainer\ThemeTemplatesListener
arguments:
Expand Down

0 comments on commit b638dd2

Please sign in to comment.