36 lines
825 B
PHP
36 lines
825 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace KupShop\SellerBundle\Twig;
|
|
|
|
trait ComponentsTemplateOverride
|
|
{
|
|
public function getTemplate(): string
|
|
{
|
|
assert(isset($this->template));
|
|
|
|
if (findModule(\Modules::COMPONENTS) && !findModule(\Modules::SELLERS, \Modules::SUB_SMARTY_SELLERS)) {
|
|
$templateName = str_replace('.tpl', '', $this->template);
|
|
|
|
return "@Seller/{$templateName}.html.twig";
|
|
}
|
|
|
|
return $this->template;
|
|
}
|
|
|
|
public function getTemplates(): iterable
|
|
{
|
|
return [$this->getTemplate()];
|
|
}
|
|
|
|
public function getEntrypoint(): string
|
|
{
|
|
if (findModule(\Modules::COMPONENTS) && !findModule(\Modules::SELLERS, \Modules::SUB_SMARTY_SELLERS)) {
|
|
return 'seller';
|
|
}
|
|
|
|
return $this->entrypoint;
|
|
}
|
|
}
|