Permalink
Browse files

ignore warnings and notices in templates

  • Loading branch information...
1 parent 3b84011 commit 9867c0f568eb13e7200b3dd47934cb599f1188a5 @shaunlee committed Sep 10, 2013
Showing with 10 additions and 0 deletions.
  1. +10 −0 ajoy/components/EasyView.php
@@ -3,6 +3,11 @@
class EasyView extends ViewHelper implements IAjoyView
{
+ /**
+ *
+ */
+ public $strict = false;
+
/**
*
*/
@@ -70,6 +75,10 @@ public function endblock()
private function renderFile($filename, $fn)
{
+ $old_error_reporting = error_reporting();
+ if ($this->strict === false)
+ error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
+
$args = array_slice(func_get_args(), 2);
foreach ($args as $arg)
extract($arg);
@@ -84,6 +93,7 @@ private function renderFile($filename, $fn)
if ($this->minify)
$ctx = $this->minify($ctx);
+ error_reporting($old_error_reporting);
return $ctx;
}

0 comments on commit 9867c0f

Please sign in to comment.