Box\Brainy\Templates\TemplateBase::fetch PHP Метод

fetch() публичный Метод

This returns the template output instead of displaying it.
public fetch ( string | void $template = null, mixed | void $compile_id = null ) : string
$template string | void the resource handle of the template file or template object
$compile_id mixed | void compile id to be used with this template
Результат string rendered template output
    public function fetch($template = null, $compile_id = null)
    {
        ob_start();
        try {
            $this->display($template, $compile_id);
        } catch (\Exception $e) {
            ob_end_clean();
            throw $e;
        }
        return ob_get_clean();
    }