Branche classes
This commit is contained in:
24
controleur/LivreControleur.php
Normal file
24
controleur/LivreControleur.php
Normal file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
require("../modele/Livre.php");
|
||||
|
||||
class LivreControleur {
|
||||
private $livre;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->livre = new Livre();
|
||||
}
|
||||
|
||||
public function ajouterLivre() {
|
||||
if (!empty($_POST['categorie']) && !empty($_POST['titre']) && !empty($_POST['auteur']) && !empty($_POST['annee'])) {
|
||||
$this->livre->ajouter($_POST['categorie'], $_POST['titre'], $_POST['auteur'], $_POST['annee']);
|
||||
}
|
||||
}
|
||||
|
||||
public function listerLivres() {
|
||||
return $this->livre->getAll();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
require("../modele/livres.php");
|
||||
require("../controleur/LivreControleur.php");
|
||||
|
||||
$livres = getLivres();
|
||||
$livres = new LivreControleur()->listerLivres();
|
||||
|
||||
include("../vue/header.php");
|
||||
include("../vue/bibliotheque.php");
|
||||
|
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
require("../modele/livres.php");
|
||||
require("../controleur/LivreControleur.php");
|
||||
require("../modele/categories.php");
|
||||
|
||||
addLivre();
|
||||
new LivreControleur()->ajouterLivre();
|
||||
$categories = getCategories();
|
||||
|
||||
include("../vue/header.php");
|
||||
|
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
class Livre {
|
||||
function getAll() {
|
||||
|
||||
}
|
||||
|
||||
function ajouter($titre, $auteur, $annee) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
?>
|
@@ -1,3 +0,0 @@
|
||||
<?php
|
||||
|
||||
?>
|
Reference in New Issue
Block a user