Skip to content
Snippets Groups Projects
Commit 6c78d636 authored by Sofiane Lasri's avatar Sofiane Lasri
Browse files

Reformatage.

parent 26177046
Branches
No related tags found
No related merge requests found
<?php
require_once("app/models/View.php");
/**
* Charge le contenu d'une vue avec des paramètres.
* @param string $viewName
* @param array $args
* @return string
......
......@@ -83,6 +83,11 @@ class View
return $viewContent;
}
/**
* @param string $viewCode
* @param array $args
* @return string
*/
public static function render(string $viewCode, array $args = []): string
{
extract($args);
......
......@@ -3,13 +3,23 @@ require_once("models/Adherent.php");
class ControleurAdherent
{
public static function lireAdherents()
/**
* Charge la page de la liste des adhérents.
* @return string
* @throws Exception
*/
public static function lireAdherents(): string
{
$adherents = Adherent::getAllAdherents();
return view('adherents.les-adherents', ['adherents' => $adherents]);
}
public static function lireAdherent()
/**
* Charge la page du détail d'un adhérent.
* @return string
* @throws Exception
*/
public static function lireAdherent(): string
{
if (empty($_GET["login"])) {
die("Le paramètre login n'est pas spécifié.");
......
<?php
require_once("models/Auteur.php");
/**
*
*/
class ControleurAuteur
{
public static function lireAuteurs()
/**
* Charge la page de la liste des auteurs.
* @return string
*/
public static function lireAuteurs() : string
{
$auteurs = Auteur::getAllAuteurs();
return view('auteurs.les-auteurs', ['auteurs' => $auteurs]);
}
public static function lireAuteur()
/**
* Charge la page du détail d'un auteur.
* @return string
*/
public static function lireAuteur() : string
{
if (empty($_GET["numAuteur"])) {
die("Le paramètre numAuteur n'est pas spécifié.");
......
......@@ -33,6 +33,10 @@ class Adherent
$this->numCategorie = $numCategorie;
}
/**
* @return array
* @throws Exception
*/
public static function getAllAdherents(): array
{
// écriture de la requête
......@@ -56,6 +60,12 @@ class Adherent
return $tableau;
}
/**
* Trouve un adhérent selon son login unique.
* @param $login
* @return Adherent
* @throws Exception
*/
public static function getAdherentByLogin($login) : Adherent
{
// écriture de la requête
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment