| | 17 | public function kohana_include_view($kohana_view_filename, $kohana_input_data) |
| | 18 | { |
| | 19 | // Buffering on |
| | 20 | ob_start(); |
| | 21 | |
| | 22 | // Import the input variables to local namespace |
| | 23 | extract($kohana_input_data, EXTR_SKIP); |
| | 24 | |
| | 25 | // Views are straight HTML pages with embedded PHP, so importing them |
| | 26 | // this way insures that $this can be accessed as if the user was in |
| | 27 | // the controller, which gives the easiest access to libraries in views |
| | 28 | include $kohana_view_filename; |
| | 29 | |
| | 30 | // Fetch the HTML output |
| | 31 | $kohana_view_output = ob_get_contents(); |
| | 32 | |
| | 33 | // Flush the buffer |
| | 34 | ob_end_clean(); |
| | 35 | |
| | 36 | // Return the view, yay! |
| | 37 | return $kohana_view_output; |
| | 38 | } |
| | 39 | |