Files
LightMVC/core/Application.php

29 lines
640 B
PHP
Executable File

<?php
namespace Core;
class Application
{
public static string $ROOT_DIR;
public Router $router;
public Request $request;
public Response $response;
public View $view;
public static Application $app;
public function __construct($rootPath)
{
self::$ROOT_DIR = $rootPath;
self::$app = $this;
$this->request = new Request();
$this->response = new Response();
$this->view = new View();
$this->router = new Router($this->request, $this->response);
}
public function run()
{
echo $this->router->resolve();
}
}