Files
domokits/local/modules/TemplateSwitcher/Controller/SwitcherController.php
2019-11-21 12:25:31 +01:00

34 lines
1.3 KiB
PHP

<?php
/*************************************************************************************/
/* Copyright (c) Franck Allimant, CQFDev */
/* email : thelia@cqfdev.fr */
/* web : http://www.cqfdev.fr */
/* */
/* For the full copyright and license information, please view the LICENSE */
/* file that was distributed with this source code. */
/*************************************************************************************/
/**
* Created by Franck Allimant, CQFDev <franck@cqfdev.fr>
* Date: 09/02/2017 22:45
*/
namespace TemplateSwitcher\Controller;
use TemplateSwitcher\Events\TemplateSwitcherEvent;
use Thelia\Controller\Front\BaseFrontController;
use Thelia\Tools\URL;
class SwitcherController extends BaseFrontController
{
public function set($templateName)
{
$this->getDispatcher()->dispatch(
TemplateSwitcherEvent::SWITCH_TEMPLATE_EVENT,
new TemplateSwitcherEvent($templateName)
);
return $this->generateRedirect(URL::getInstance()->absoluteUrl('/'));
}
}