(Yaf >=1.0.0)
Yaf_View_Simple::setScriptPath — Set the template directory
Sets the directory in which templates are looked up.
template_dirThe directory where the template scripts are stored.
Returns the view instance, or false if template_dir is not an absolute path.
Example #1 Yaf_View_Simple::setScriptPath() example
<?php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
/* render templates from another directory */
$this->getView()->setScriptPath(APPLICATION_PATH . "/modules/admin/views");
$this->getView()->display("dashboard/index.phtml");
return false; // we rendered ourselves, skip auto-rendering
}
}
?>