allow to activate debugging into Smarty

This commit is contained in:
Manuel Raynaud
2013-06-21 10:48:57 +02:00
parent 3473e48a3f
commit e801717f0d
2 changed files with 4 additions and 1 deletions

View File

@@ -53,6 +53,7 @@
<argument type="service" id="event_dispatcher"/>
<argument >false</argument>
<argument >%kernel.environment%</argument>
<argument >%kernel.debug%</argument>
</service>
<!-- Smarty parser plugins -->

View File

@@ -33,7 +33,7 @@ class SmartyParser extends Smarty implements ParserInterface {
* @param bool $template
* @param string $env Environment define for the kernel application. Used for the cache directory
*/
public function __construct(Request $request, EventDispatcherInterface $dispatcher, $template = false, $env = "prod")
public function __construct(Request $request, EventDispatcherInterface $dispatcher, $template = false, $env = "prod", $debug = false)
{
parent::__construct();
@@ -53,6 +53,8 @@ class SmartyParser extends Smarty implements ParserInterface {
$this->setCompileDir($compile_dir);
$this->setCacheDir($cache_dir);
$this->debugging = $debug;
// Prevent smarty ErrorException: Notice: Undefined index bla bla bla...
$this->error_reporting = E_ALL ^ E_NOTICE;