1 | <?php |
||
13 | class Kohana_View_Model { |
||
|
|||
14 | |||
15 | /** |
||
16 | * Captures the output that is generated when a view is included. |
||
17 | * The view data will be extracted to make local variables. |
||
18 | * |
||
19 | * $output = $this->capture($file); |
||
20 | * |
||
21 | * @param string filename |
||
22 | * @return string |
||
23 | */ |
||
24 | protected function capture($kohana_view_filename) |
||
50 | |||
51 | /** |
||
52 | * Magic method, returns the output of [View::render]. |
||
53 | * |
||
54 | * @return string |
||
55 | * @uses View::render |
||
56 | */ |
||
57 | public function __toString() |
||
71 | |||
72 | /** |
||
73 | * Sets the view filename. |
||
74 | * |
||
75 | * $view->set_filename($file); |
||
76 | * |
||
77 | * @param string view filename |
||
78 | * @return View |
||
79 | * @throws Kohana_View_Exception |
||
80 | */ |
||
81 | public function set_filename($file) |
||
95 | |||
96 | /** |
||
97 | * Renders the view object to a string. Global and local data are merged |
||
98 | * and extracted to create local variables within the view file. |
||
99 | * |
||
100 | * $output = View::render(); |
||
101 | * |
||
102 | * [!!] Global variables with the same key name as local variables will be |
||
103 | * overwritten by the local variable. |
||
104 | * |
||
105 | * @param string view filename |
||
106 | * @return string |
||
107 | * @throws Kohana_View_Exception |
||
108 | * @uses View::capture |
||
109 | */ |
||
110 | public function render($file = NULL) |
||
116 | } // End View |
||
117 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.