public function jsonAction(FrontControllerInterface $app)
 {
     $response = $app->get('response');
     $response->setContentType('json')->setContents(array("var" => "val"));
     return $response;
 }
 public function defaultLayoutAction(TemplateEngineInterface $template_engine, FrontControllerInterface $app)
 {
     $layout = $template_engine->getDefaultLayout();
     $req = $app->get('request')->getBaseUrl();
     $content = $template_engine->renderTemplate(self::$views_dir . 'lorem_ipsum_content.php');
     $content .= $app->callControllerAction(null, 'loremipsum');
     $content .= $app->callRoute('/hello/your-name', array('name' => 'your-new-name'));
     $layout->addParam('title', 'My test layout')->addParam('hat', 'a simple bootstrap canvas')->addParam('logo', 'http://lorempixel.com/400/200/')->addParam('menu', array('home' => $req . '/', 'item 1' => '#', 'item 2' => '#'))->addParam('breadcrumb', array('home' => $req . '/', 'default_layout' => $req . '/default_layout'))->addParam('messages', array('This is a system message ...', 'danger' => 'this is a system "danger" message'))->setChildParam('content', 'title', 'Global test content')->setChildParam('content', 'content', $content)->setChildParam('aside', 'title', 'Test aside column')->setChildParam('aside', 'content', $template_engine->renderTemplate(self::$views_dir . 'left_block.php'))->setChildParam('extra', 'title', 'Test extra column')->setChildParam('extra', 'content', $template_engine->renderTemplate(self::$views_dir . 'left_block.php'))->setChildParam('footer', 'content', 'My test footer info ...')->setChildParam('footer', 'content_left', 'My test left footer info ...')->setChildParam('footer', 'content_right', 'My test right footer info ...');
     return $layout->renderLayout();
 }