You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.6 KiB
70 lines
1.6 KiB
<?php
|
|
namespace Controleur;
|
|
|
|
use Model\QuoteModel;
|
|
use Model\SearchModel;
|
|
use Gateway\Connection;
|
|
use Gateway\QuoteGateway;
|
|
use Gateway\AccueilGateway;
|
|
|
|
class VisitorControler {
|
|
|
|
private QuoteModel $qMod;
|
|
private AccueilGateway $accueilGateway;
|
|
|
|
private SearchModel $sMod;
|
|
|
|
public function __construct(){
|
|
global $co;
|
|
$this->qMod = new QuoteModel(new QuoteGateway($co));
|
|
$this->accueilGateway = new AccueilGateway($co);
|
|
}
|
|
|
|
public function accueil() {
|
|
global $vues;
|
|
|
|
// Récupérer la citation du jour via AccueilGateway
|
|
$citationDuJour = $this->accueilGateway->getQuoteOfTheDay('fr');
|
|
$suggestions = $this->accueilGateway->getSuggestions(0, 'fr');
|
|
|
|
// Passer les données à la vue
|
|
require_once $vues['accueil'];
|
|
}
|
|
|
|
public function quote(array $arg) {
|
|
global $vues;
|
|
|
|
$id=$arg['idQuote'];
|
|
|
|
$q = $this->qMod->searchId($id);
|
|
require_once $vues['quote'];
|
|
}
|
|
|
|
public function login() {
|
|
global $vues;
|
|
require_once $vues['login'];
|
|
}
|
|
|
|
public function signin() {
|
|
global $vues;
|
|
require_once $vues['signin'];
|
|
}
|
|
|
|
public function favorite() {
|
|
global $vues;
|
|
require_once $vues['favorite'];
|
|
}
|
|
|
|
public function search(array $arg){
|
|
global $vues;
|
|
|
|
$type = ($_POST['type'] ?? "");
|
|
$search = ($_POST['search'] ?? NULL);
|
|
$filtre = ($arg['filtre'] ?? []);
|
|
|
|
|
|
$tq=$this->sMod->searchQuote($type,$search,$filtre);
|
|
|
|
require_once $vues['search'];
|
|
}
|
|
} |