public function include_view($template, array $args = array()) { $view = new View($this->container, $template); foreach ($args as $key => $value) { $view->set($key, $value); } $view->render(); }
public function allAction() { $images = new ImageCollection(); $loaded = $images->load($this->get("connection")); if (!$loaded) { throw new DatabaseException("cannot fetch images"); } $view = new View($this->container, "gallery"); $view->set("images", $images->models); return $view; }
public function renderForm(Article $article = null, ArticleForm $form = null) { if (!$form) { $form = new ArticleForm(); } if ($article) { $form->bindFromModel($article); $form->bind("id", $article->get("id")); } $form->setCSRF($this->get("csrf_guard")); $view = new View($this->container, "article_edit"); $view->set("form", $form); return $view; }