/** * Renders HTML via the given template and returns a response object. * * @param string $view Template name * @param array $variables An array of template variables * @return \Apricot\Foundation\Response\RenderResponse */ function render(string $view=null, array $variables=[]):Apricot\Foundation\Response\RenderResponse { $variables['errors'] = errors(); $html = isset($view) ? Apricot\View::run($view, $variables) : null; return new Apricot\Foundation\Response\RenderResponse($html); }