class Response { // ... /** * adds a simple template mechanism to the response class * @param string $template the path and name of the template file * @return void */ function addBodyTemplate($template, $vars=array()) { if (file_exists($template)) { extract($vars); ob_start(); include $template; $this->_body .= ob_get_clean(); } } }