I can't understand what is "rendering a view". I'm reading Zend Framework manual and there are a lot of usage of this term.
Automatically rendering views:
This helper takes care of injecting the view object into the controller, as well as automatically rendering views.
Disable rendering for a view:
You can also simply disable rendering for an individual view
render()
renders a view script.
render() renders a view script.
Render that template in the subdirectory
Passing a value for $action will render that template in the /[controller]/ subdirectory.
And so on.
I found the render()
method. I fact many component classes of Zend_Controller
have render()
method. But all of them at long last anyway call only the one from the Zend_View_Abstract
class. And the only thing I could see in its realization is that it seems it just puts the html-script into the output buffer:
public function render($name) {
// find the script file name using the parent private method
$this->_file = $this->_script($name);
unset($name); // remove $name from local scope
ob_start();
$this->_run($this->_file);
return $this->_filter(ob_get_clean()); // filter output
}
Unfortunately there is no realization of the _run()
method and I don't know what it has to do, how to include script in a scope. Is this what is meant by include - include_once("/myScritp.php")
?
/**
* Use to include the view script in a scope that only allows public
* members.
*
* @return mixed
*/
abstract protected function _run();
So what does it mean to "render a view"? Just to include the script and put it into the output buffer and get it in some variable (return ob_get_clean()
) then?