public function __invoke(Request $request, Response $response, WikiPage $wikiPage)
 {
     $this->request = $request;
     $this->response = $response;
     $this->wikiPageSource = clone $wikiPage;
     $this->redirect($wikiPage->getPath());
     return $this->response;
 }
예제 #2
0
 public function __invoke(WikiPage $wikiPage)
 {
     $meta = $wikiPage->getMeta();
     if (empty($meta['template'])) {
         $template = $this->twig->loadTemplate('wikipage.twig.html');
     } else {
         $template = $this->twig->loadTemplate($meta['template']);
     }
     $breadcrumbLinks = $this->breadcrumbs($wikiPage->getPath());
     $breadcrumbActive = array_pop($breadcrumbLinks);
     $content = $template->render(array('breadcrumbLinks' => $breadcrumbLinks, 'breadcrumbActive' => $breadcrumbActive, 'content' => $this->twig->createTemplate($wikiPage->getContent()), 'source' => $wikiPage->getSource()));
     $wikiPage->setContent($content);
     return $wikiPage;
 }