getArticle
The getArticle
hook allows you to override the configuration of an article
prior to rendering. It does not expect a return value.
Parameters
\Contao\ArticleModel
$article
The database result from table
tl_article
.
Example
// src/EventListener/GetArticleListener.php
namespace App\EventListener;
use Contao\CoreBundle\DependencyInjection\Attribute\AsHook;
use Contao\ArticleModel;
#[AsHook('getArticle')]
class GetArticleListener
{
public function __invoke(ArticleModel $article): void
{
// Modify $article here …
}
}