Skip to content

Instantly share code, notes, and snippets.

@gossi
Last active December 19, 2015 08:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gossi/5928634 to your computer and use it in GitHub Desktop.
Save gossi/5928634 to your computer and use it in GitHub Desktop.
Keeko Stub App
<?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