Skip to content

Instantly share code, notes, and snippets.

@teiling88
Created November 22, 2019 08:13
Show Gist options
  • Save teiling88/5b05d3571a5e4557bfe945e7c35aa1fd to your computer and use it in GitHub Desktop.
Save teiling88/5b05d3571a5e4557bfe945e7c35aa1fd to your computer and use it in GitHub Desktop.
Template Registration Shopware 5
<?php declare(strict_types=1);
namespace SwagEnterprisePricingEngine\Subscriber;
use Enlight\Event\SubscriberInterface;
class BasicSubscriber implements SubscriberInterface
{
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents(): array
{
return [
'Theme_Inheritance_Template_Directories_Collected' => 'onTemplateDirectoriesCollect',
];
}
public function onTemplateDirectoriesCollect(\Enlight_Event_EventArgs $args)
{
$dirs = $args->getReturn();
$dirs[] = __DIR__ . '/../Views';
$args->setReturn($dirs);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment