function template_render() { //$app = new \Yare\App(); //$app->run(); $loader = \Yare\Autoloader::instance(); pc($loader, 'loader'); $ViewClass = $loader->view(); $view = new $ViewClass(); $view->render(); }
public function model() { if (!is_array($this->models)) { $object = get_queried_object(); if ($object instanceof \WP_Post) { return 'Post'; } elseif ($object instanceof \WP_Term) { return 'Term'; } elseif ($object instanceof \WP_Comment) { return 'Comment'; } elseif ($object instanceof \WP_User) { return 'User'; } else { return 'Model'; } } $loader = Autoloader::instance(); foreach ($loader->mapKeys() as $layout) { if ($model = array_get($this->models, $layout)) { return $model; } } return 'Model'; }