SAND-framework/application/class/Application.php

44 lines
951 B
PHP
Raw Normal View History

<?php
/**
* Package MVC\Classe
* @author Emmanuel ROY
* @license MIT-licence (open source)
* @version 3.5
*/
namespace MVC\Classe;
class Application
{
public $http;
public $url;
public $browser;
public $route;
public $controlleur;
2020-12-09 10:26:26 +01:00
public function __construct()
{
$this->http = new HttpMethod();
$this->browser = new Browser();
$this->url = new Url($this->http->method, $this->browser->isAppRequest());
$dispacher = new Dispacher();
$this->route = $dispacher->route;
}
2020-12-09 10:26:26 +01:00
public function launch()
{
$this->controlleur = new Controlleur($this);
//si la page n'est un controlleur d'action alors on affiche l'écran
2020-12-09 10:26:26 +01:00
if (!$this->url->page['control']) {
print($this->controlleur->vue->ecran);
//si on affiche l'écran alors on vide les alertes de la session
\MVC\Object\Alert::remove();
}
}
}