public static function markup_render(array $args, $engine, $template) { $thisArg = $args['select']; unset($args['select']); if (is_array($thisArg)) { $thisArg = new \ArrayObject($thisArg); } $renderer = Render\get_renderer(); $html = $renderer->render($thisArg, $args + ['locals' => $engine->context->to_array()]); return $template ? $engine($template, $html) : $html; }
/** * Returns a view for a controller. * * @param Controller $controller * * @return View */ public static function controller_get_view(Controller $controller) { $view = new View($controller, Render\get_renderer()); new View\AlterEvent($view); return $view; }
/** * Returns a clone of the shared renderer. * * @return Renderer */ public static function get_renderer() { return clone Render\get_renderer(); }