refactor render template process
This commit is contained in:
@@ -199,7 +199,7 @@ class BaseAdminController extends BaseController
|
||||
$parser = $this->container->get("thelia.parser");
|
||||
|
||||
// Define the template thant shoud be used
|
||||
$parser->addTemplateDir($template ?: ConfigQuery::read('base-admin-template', 'admin/default'), 'default');
|
||||
$parser->setTemplate($template ?: ConfigQuery::read('base-admin-template', 'admin/default'), 'default');
|
||||
|
||||
return $parser;
|
||||
}
|
||||
|
||||
@@ -311,6 +311,11 @@ class BaseController extends ContainerAware
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* return an instance of SmartyParser
|
||||
*
|
||||
* Caution : maybe there is still not default template defined.
|
||||
*
|
||||
* @return ParserInterface instance parser
|
||||
*/
|
||||
protected function getParser()
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Thelia\Controller\Front;
|
||||
use Symfony\Component\Routing\Router;
|
||||
use Thelia\Controller\BaseController;
|
||||
use Thelia\Model\AddressQuery;
|
||||
use Thelia\Model\ConfigQuery;
|
||||
use Thelia\Model\ModuleQuery;
|
||||
use Thelia\Tools\URL;
|
||||
|
||||
@@ -83,4 +84,16 @@ class BaseFrontController extends BaseController
|
||||
$this->redirectToRoute("order.invoice");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return ParserInterface instance parser
|
||||
*/
|
||||
protected function getParser()
|
||||
{
|
||||
$parser = $this->container->get("thelia.parser");
|
||||
|
||||
$parser->setTemplate(ConfigQuery::getActiveTemplate());
|
||||
|
||||
return $parser;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user