2015-04-15 14:45:54 +02:00
|
|
|
<?php
|
|
|
|
|
2019-03-14 16:48:02 +01:00
|
|
|
namespace MVC\Classe;
|
2015-04-15 14:45:54 +02:00
|
|
|
|
|
|
|
class Application
|
|
|
|
{
|
2019-12-04 15:21:19 +01:00
|
|
|
public $http;
|
2019-12-05 00:50:23 +01:00
|
|
|
public $url;
|
2019-12-04 15:21:19 +01:00
|
|
|
public $browser;
|
2019-12-05 14:05:38 +01:00
|
|
|
public $route;
|
2019-12-04 15:21:19 +01:00
|
|
|
|
2019-12-05 00:50:23 +01:00
|
|
|
|
|
|
|
public function __construct(){
|
2019-12-04 15:21:19 +01:00
|
|
|
$this->http = new HttpMethod();
|
|
|
|
$this->browser = new Browser();
|
2020-04-01 09:19:34 +02:00
|
|
|
|
2019-12-04 15:21:19 +01:00
|
|
|
$this->url = new Url($this->http->method, $this->browser->isAppRequest());
|
2019-12-05 14:05:38 +01:00
|
|
|
|
|
|
|
$dispacher = new Dispacher();
|
|
|
|
$this->route = $dispacher->route;
|
2019-12-05 00:50:23 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public function launch(){
|
2019-12-05 14:05:38 +01:00
|
|
|
//print_r($this->route);
|
2019-12-05 00:50:23 +01:00
|
|
|
$controlleur = new Controlleur($this);
|
|
|
|
//si la page n'est un controlleur d'action alors on affiche l'écran
|
|
|
|
if(!$this->url->page['control']) {
|
2019-03-14 10:30:11 +01:00
|
|
|
print($controlleur->vue->ecran);
|
|
|
|
}
|
2019-12-05 00:50:23 +01:00
|
|
|
}
|
|
|
|
|
2015-04-15 14:45:54 +02:00
|
|
|
}
|