$this->_render()
is used within the views to include elements. Any variables passed from the controller to the parent view are also available in the element. The third argument of $this->_render()
can be used to pass additional variables.
<?php
// renders app/views/elements/nav.html.php
echo $this->_render('element', 'nav');
?>
Relative pathing works, so if you want to reuse a template from say app/views/events/add.html.php
, you can do this:
<?=$this->_render('element', '../events/add'); ?>