Skip to content

Commit

Permalink
Extend from AbstractFrontendModuleController (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
leofeyer committed Jan 17, 2022
1 parent 7b69035 commit 6335a6b
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,20 @@
namespace Contao\CoreBundle\Controller\FrontendModule;

use Contao\Controller;
use Contao\CoreBundle\Controller\AbstractFragmentController;
use Contao\ModuleModel;
use Contao\StringUtil;
use Contao\Template;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;

class RootPageDependentModulesController extends AbstractFragmentController
class RootPageDependentModulesController extends AbstractFrontendModuleController
{
public function __invoke(Request $request, ModuleModel $model, string $section, array $classes = null): Response
{
if ($this->container->get('contao.routing.scope_matcher')->isBackendRequest($request)) {
return $this->getBackendWildcard($model);
}

if (!$pageModel = $this->getPageModel()) {
return new Response('');
}
Expand All @@ -40,4 +44,9 @@ public function __invoke(Request $request, ModuleModel $model, string $section,

return new Response($content);
}

public function getResponse(Template $template, ModuleModel $model, Request $request): Response
{
throw new \LogicException('This method should never be called');
}
}

0 comments on commit 6335a6b

Please sign in to comment.