resetTemplate example


    private $container;

    public function __construct(ContainerInterface $container)
    {
        $this->container = $container;
    }

    public function registerShop(Shop $shop): void
    {
        $this->registerResources($shop);
        $this->resetTemplate($shop);
    }

    public function registerResources(Shop $shop): void
    {
        $this->container->set('shop', $shop);

        $locale = $this->container->get(Zend_Locale::class);
        $locale->setLocale($shop->getLocale()->toString());

        $currency = $this->container->get(Zend_Currency::class);
        $currency->setLocale($locale);
        
$container->load('front');
        $container->load('plugins');

        foreach ($container->get('kernel')->getPlugins() as $plugin) {
            if (!$plugin->isActive()) {
                continue;
            }
            $container->get('events')->addSubscriber($plugin);
        }
        if ($container->initialized('shop')) {
            $container->get(ShopRegistrationServiceInterface::class)->resetTemplate($container->get('shop'));
        }
    }

    /** * Reset the request object * * @return Enlight_Components_Test_Controller_TestCase */
    public function resetRequest()
    {
        if ($this->_request instanceof Enlight_Controller_Request_RequestTestCase) {
            
Home | Imprint | This part of the site doesn't use cookies.