Skip to content
Browse files

Restore $response->_view after render()

  • Loading branch information...
1 parent cf36b8a commit 93ed8f3e6d914d940f86781f78b84ccbd029af38 @abackstrom committed Apr 25, 2012
Showing with 6 additions and 1 deletion.
  1. +6 −1 klein.php
View
7 klein.php
@@ -522,6 +522,8 @@ public function yield() {
//Renders a view + optional layout
public function render($view, array $data = array()) {
+ $original_view = $this->_view;
+
if (!empty($data)) {
$this->set($data);
}
@@ -534,6 +536,9 @@ public function render($view, array $data = array()) {
if (false !== $this->chunked) {
$this->chunk();
}
+
+ // restore state for parent render()
+ $this->_view = $original_view;
}
// Renders a view without a layout
@@ -757,4 +762,4 @@ public function __call( $method, $args ) {
return call_user_func_array( $this->$method, $args );
}
}
-}
+}

0 comments on commit 93ed8f3

Please sign in to comment.
Something went wrong with that request. Please try again.