Why buffer when connecting a template? Sorry for the "stupid" question, just do not understand this moment. And if you do not do buffering, will everything be bad?) Thanks in advance for the answer!
class View { function render($tpl, $data) { extract($data); ob_start(); include $tpl; return ob_get_clean(); } }
return 'большая-большая строка';
. If something is displayed in the file, it will not fall into the variable. - etki