Esempio n. 1
0
 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();
 }
Esempio n. 2
0
 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;
 }
Esempio n. 3
0
 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;
 }