Browse Source

Allow templates to echo as well

Nathaniel van Diepen 7 years ago
parent
commit
0343c450ba
1 changed files with 3 additions and 0 deletions
  1. 3 0
      Data/template.class.php

+ 3 - 0
Data/template.class.php

@@ -23,7 +23,10 @@
 			if($this->fire('before', $data) === false){
 				throw new Exception("Render on template {$this->name} cancelled. Before.");
 			}
+			ob_start();
 			$output = \Closure::FromCallable($this->template)->call($data);
+			$output .= ob_get_contents();
+			ob_end_clean();
 			if($this->fire('after', $output) === false){
 				throw new Exception("Render on template {$this->name} cancelled. After");
 			}