Last active
December 19, 2015 08:49
-
-
Save gossi/5928634 to your computer and use it in GitHub Desktop.
Keeko Stub App
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Stub extends AbstractApp { | |
public function run(Request $req) { | |
$router = new ModuleActionRouter('stub', $this->appRouter->getPrefix()); | |
$route = $router->match($this->appRouter->getDestination()); | |
$main = ''; | |
try { | |
$moduleManager = new ModuleManager($this->classLoader); | |
$moduleManager->load($route['module']); | |
} catch (ModuleException $e) { | |
$main = $e->getMessage(); | |
} | |
$loader = new \Twig_Loader_Filesystem( | |
$this->root . DIRECTORY_SEPARATOR . 'templates'); | |
$twig = new \Twig_Environment($loader); | |
echo $twig->render('main.twig', array('main' => $main)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment