Initial commit: is_searchbar out of the box. v3.0.1

This commit is contained in:
Isabelle Anno
2025-11-19 13:26:29 +01:00
commit 94832a4c74
52 changed files with 7101 additions and 0 deletions

View File

@ -0,0 +1,35 @@
<?php
declare(strict_types=1);
namespace Oksydan\IsSearchbar\Hook;
abstract class AbstractDisplayHook extends AbstractHook
{
public function execute(array $params): string
{
if (!$this->shouldBlockBeDisplayed($params)) {
return '';
}
$this->assignTemplateVariables($params);
return $this->module->fetch($this->getTemplateFullPath());
}
protected function assignTemplateVariables(array $params)
{
}
protected function shouldBlockBeDisplayed(array $params)
{
return true;
}
public function getTemplateFullPath(): string
{
return "module:{$this->module->name}/views/templates/hook/{$this->getTemplate()}";
}
abstract protected function getTemplate(): string;
}