diff --git a/src/Controller/FrontendModule/MeilisearchSearchController.php b/src/Controller/FrontendModule/MeilisearchSearchController.php index 91c1476..d91af56 100644 --- a/src/Controller/FrontendModule/MeilisearchSearchController.php +++ b/src/Controller/FrontendModule/MeilisearchSearchController.php @@ -2,23 +2,24 @@ namespace MummertMedia\ContaoMeilisearchBundle\Controller\FrontendModule; -use Contao\FrontendModule; +use Contao\CoreBundle\Controller\AbstractFrontendModuleController; +use Contao\ModuleModel; +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; -class MeilisearchSearchController extends FrontendModule +class MeilisearchSearchController extends AbstractFrontendModuleController { - /** - * Template - */ - protected $strTemplate = 'mod_meilisearch_search'; - - /** - * Compile the frontend module - */ - protected function compile(): void - { - // Fallback, falls das Feld leer ist - $limit = (int) ($this->meiliLimit ?: 50); - - $this->Template->meiliLimit = $limit; + protected function getResponse( + ModuleModel $model, + string $section, + array $classes = null, + Request $request = null + ): Response { + return $this->render( + 'mod_meilisearch_search.html.twig', + [ + 'meiliLimit' => (int) ($model->meiliLimit ?: 50), + ] + ); } } \ No newline at end of file