HosipLan

Untitled

May 21st, 2011
384
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. /**
  4.  * My Application bootstrap file.
  5.  */
  6.  
  7.  
  8. use Nette\Diagnostics\Debugger;
  9. use Nette\Environment;
  10. use Nette\Application\Routers\Route;
  11.  
  12.  
  13. // Load Nette Framework
  14. // this allows load Nette Framework classes automatically so that
  15. // you don't have to litter your code with 'require' statements
  16. require LIBS_DIR . '/Nette/loader.php';
  17.  
  18.  
  19. // Enable Nette\Debug for error visualisation & logging
  20. Debugger::enable();
  21. Debugger::$strictMode = TRUE;
  22.  
  23. $configurator = new Kdyby\Configurator;
  24. $configurator->loadConfig(APP_DIR . '/config.neon', 'production');
  25. $application = $configurator->container->application;
  26.  
  27. $application->errorPresenter = 'Error';
  28. //$application->catchExceptions = TRUE;
  29.  
  30. // Setup router
  31. $application->onStartup[] = function() use ($application) {
  32.     $router = $application->getRouter();
  33.  
  34.     $router[] = new Route('index.php', 'Homepage:default', Route::ONE_WAY);
  35.  
  36.     $router[] = new Route('<presenter>/<action>[/<id>]', 'Homepage:default');
  37. };
  38.  
  39.  
  40. // Run the application!
  41. $application->run();
Advertisement
Add Comment
Please, Sign In to add comment