Permalink
Browse files

Replace HomePageAction with JSON response

  • Loading branch information...
stringerbell committed May 29, 2016
1 parent 623e977 commit 6b21dd5c88c06a3f6eed5bf2cfcdacb8762e4b49
Showing with 1 addition and 32 deletions.
  1. +1 −32 src/App/Action/HomePageAction.php
@@ -26,37 +26,6 @@ public function __construct(Router\RouterInterface $router, Template\TemplateRen
public function __invoke(ServerRequestInterface $request, ResponseInterface $response, callable $next = null)
{
$data = [];
if ($this->router instanceof Router\AuraRouter) {
$data['routerName'] = 'Aura.Router';
$data['routerDocs'] = 'http://auraphp.com/packages/2.x/Router.html';
} elseif ($this->router instanceof Router\FastRouteRouter) {
$data['routerName'] = 'FastRoute';
$data['routerDocs'] = 'https://github.com/nikic/FastRoute';
} elseif ($this->router instanceof Router\ZendRouter) {
$data['routerName'] = 'Zend Router';
$data['routerDocs'] = 'http://framework.zend.com/manual/current/en/modules/zend.mvc.routing.html';
}
if ($this->template instanceof PlatesRenderer) {
$data['templateName'] = 'Plates';
$data['templateDocs'] = 'http://platesphp.com/';
} elseif ($this->template instanceof TwigRenderer) {
$data['templateName'] = 'Twig';
$data['templateDocs'] = 'http://twig.sensiolabs.org/documentation';
} elseif ($this->template instanceof ZendViewRenderer) {
$data['templateName'] = 'Zend View';
$data['templateDocs'] = 'http://framework.zend.com/manual/current/en/modules/zend.view.quick-start.html';
}
if (!$this->template) {
return new JsonResponse([
'welcome' => 'Congratulations! You have installed the zend-expressive skeleton application.',
'docsUrl' => 'zend-expressive.readthedocs.org',
]);
}
return new HtmlResponse($this->template->render('app::home-page', $data));
return new JsonResponse("ok");
}
}

0 comments on commit 6b21dd5

Please sign in to comment.