Initial commit of LightMVC framework files.
This commit is contained in:
Executable
+28
@@ -0,0 +1,28 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user