Refactor : Mettre tout le code dans un sous-dossier.
La racine du site contient les fichiers README et LICENCE, ainsi que le dossier __cms__, dans lequel se situe tout le code. Les autres fichiers / dossiers du site sont les fichiers et dossiers du site web à proprement parler : - Les images - Les pages (un fichier index.php qui appelle le script principal __cms__/cms.php
18
__cms__/cms.php
Normal file
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
require_once("controleur/page.php");
|
||||
|
||||
require_once("types/galerie.php");
|
||||
require_once("types/galerie-periode.php");
|
||||
require_once("types/galerie-evenement.php");
|
||||
require_once("types/galerie-photo.php");
|
||||
|
||||
class CMS {
|
||||
public static function affiche($url) {
|
||||
$p = Page::_new("/galerie");
|
||||
|
||||
echo "<h1>Test</h1>";
|
||||
echo $p->vue();
|
||||
}
|
||||
}
|
||||
?>
|
Before Width: | Height: | Size: 924 B After Width: | Height: | Size: 924 B |
Before Width: | Height: | Size: 1012 B After Width: | Height: | Size: 1012 B |
Before Width: | Height: | Size: 915 B After Width: | Height: | Size: 915 B |
Before Width: | Height: | Size: 1004 B After Width: | Height: | Size: 1004 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
10
index.php
|
@ -1,13 +1,7 @@
|
|||
<h1>Test</h1>
|
||||
<?php
|
||||
|
||||
require_once("types/galerie.php");
|
||||
require_once("types/galerie-periode.php");
|
||||
require_once("types/galerie-evenement.php");
|
||||
require_once("types/galerie-photo.php");
|
||||
require_once("__cms__/cms.php");
|
||||
|
||||
$p = Page::_new("/galerie");
|
||||
|
||||
print_r($p->vue());
|
||||
CMS::affiche($_SERVER[REQUEST_URI]);
|
||||
|
||||
?>
|