<?php
class IndexController extends Yaf_Controller_Abstract
{
public function indexAction()
{
$template = "<h1><?php echo htmlspecialchars($title); ?></h1>";
/* render the template string without touching the filesystem */
$html = $this->getView()->eval($template, array("title" => "Breaking News"));
$this->getResponse()->setBody($html);
return false; // skip auto-rendering
}
}
?>
The above example will output
something similar to: