<?php error_reporting(E_ALL); ini_set("display_errors", 1); //Get app paths require __DIR__ . '/../paths.php'; //Require the bootstrap file containing the autoloader require __DIR__ . '/../bootstrap.php'; //Get the router $router = App\Router::getInstance(); //Despatch the controller route requested $router->dispatch();
/** * @return Nette\Application\IRouter */ public function createServiceRouting__router() { $service = App\Router::vytvoritRouter(); if (!$service instanceof Nette\Application\IRouter) { throw new Nette\UnexpectedValueException('Unable to create service \'routing.router\', value returned by factory is not Nette\\Application\\IRouter type.'); } return $service; }
<?php return ['dependencies' => ['invokables' => [Zend\Expressive\Router\RouterInterface::class => Zend\Expressive\Router\FastRouteRouter::class], 'factories' => []], 'routes' => [['name' => 'home', 'path' => '/', 'middleware' => App\Action\HomePageAction::class, 'allowed_methods' => ['GET']], App\Router::resolver()]];
<?php require_once '../src/App/Config.php'; \App\Config::setDirectory('../config'); $config = \App\Config::get('autoload'); require_once $config['class_path'] . '/App/Autoloader.php'; if (!isset($_SERVER['PATH_INFO']) || empty($_SERVER['PATH_INFO']) || $_SERVER['PATH_INFO'] == '/') { $route = 'list'; } else { $route = $_SERVER['PATH_INFO']; } $router = new \App\Router(); $router->start($route);