Browse Source

Added "view.filter" event so we can hook in final filters.

Taylor Otwell 12 years ago
parent
commit
a976c555e6
1 changed files with 11 additions and 1 deletions
  1. 11 1
      laravel/view.php

+ 11 - 1
laravel/view.php

@@ -367,7 +367,17 @@ class View implements ArrayAccess {
 			ob_get_clean(); throw $e;
 			ob_get_clean(); throw $e;
 		}
 		}
 
 
-		return ob_get_clean();
+		$content = ob_get_clean();
+
+		// The view filter event gives us a last chance to modify the
+		// evaluated contents of the view and return them. This lets
+		// us do something like run the contents through Jade, etc.
+		if (Event::listeners('view.filter'))
+		{
+			return Event::first('view.filter', $content);
+		}
+
+		return $content;
 	}
 	}
 
 
 	/**
 	/**