Skip to content

Commit

Permalink
Fixing render
Browse files Browse the repository at this point in the history
  • Loading branch information
PurpleBabar committed Jul 19, 2015
1 parent aa91b6c commit a822586
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

if (!is_null($route)){
if (isset($route['controller'])) {

$controlling = explode('::',$route['controller']);

$controller = $controlling[0];
Expand All @@ -64,18 +64,18 @@
$controller->addFunctions(array($assets, $path));
$method = $controlling[1];

call_user_func_array(array($controller, $method), $route['route_params']);
echo call_user_func_array(array($controller, $method), $route['route_params']);

}elseif (isset($route['template'])) {

$twiger = new Twiger( array_merge($constants, $route['params']) );
$twiger->addFunctions(array($assets, $path));
$twiger->render($route['template'].'.html.twig', $route['route_params'] );
echo $twiger->render($route['template'].'.html.twig', $route['route_params'] );

}
}else{
$twiger = new Twiger();
$twiger->addFunctions(array($assets, $path));
$twiger->render('404.html.twig', array('route' => $requestUri));
echo $twiger->render('404.html.twig', array('route' => $requestUri));
http_response_code(404);
}

0 comments on commit a822586

Please sign in to comment.