/** * Render View * @param string $name * @param array $options * @return string */ public static function make($name, $options = []) { $theme = !isset($options['theme']) ? '_default' : $options['theme']; $title = !isset($options['title']) ? '' : $options['title']; $params = !isset($options['params']) ? [] : $options['params']; $themeOptions = Options::ofTheme($theme); $header = Ui::render(self::themePath($theme, 'header'), $themeOptions['header']); $footer = Ui::render(self::themePath($theme, 'footer'), $themeOptions['footer']); $params['title'] = $title; $content = Ui::render(self::viewPath($name), $params); return Ui::render(self::themePath($theme), ['title' => $title, 'header' => $header, 'footer' => $footer, 'content' => $content, 'assets' => $themeOptions['assets']]); }
/** * * @param string $name * @param array $data * @return string */ public function getWidget($name, $data = []) { return Ui::render(self::widgetPath($name), $data); }