Пример #1
0
 /**
  * @param Request $request
  * @param Response $response
  * @return bool
  */
 public function run(Request $request, Response $response)
 {
     $routes = App::instance()->getConfig('routes');
     $router = App::instance()->getService('router');
     $router->setRoutes($routes);
     $controller = $router->getController($request);
     $actionData = $router->getAction($request);
     $request->setController($controller);
     $request->setAction($actionData['name']);
     $request->setParameters($actionData['params']);
     return true;
 }
Пример #2
0
<?php

use mvc\App;
define('PATH_ROOT', __DIR__ . '/../');
define('PATH_CONFIG', PATH_ROOT . "/config/");
require __DIR__ . '/../vendor/autoload.php';
require __DIR__ . '/../mvc/Bootstrap.php';
spl_autoload_register(['Bootstrap', 'loadClass']);
App::instance()->run();