Beispiel #1
0
 /**
  * Main routing out of the home page.
  *
  * @param Request     $request [description]
  * @param Application $app     [description]
  * @param string      $page    the route/link used from the home page
  *
  * @return twig template        the requested twig template.
  */
 public function routeAction(Request $request, Application $app, $pageRoute)
 {
     $db = new DbRepository($app['dbh']);
     $pageName = $db->getPageName($pageRoute);
     $singlePage = $db->getSinglePage($pageName);
     $content = $db->getContent($pageName);
     $allContent = $db->getAllPagesContent();
     $args_array = array('pageName' => $singlePage->getPageName(), 'content' => $content, 'allContent' => $allContent);
     return $app['twig']->render($singlePage->getPageTemplate() . '.html.twig', $args_array);
 }