mise en place des header dans les html
This commit is contained in:
parent
b8e4a45ec7
commit
3d9826a983
@ -4,7 +4,7 @@ namespace Portfolio\Configure\Database;
|
||||
|
||||
use PDO;
|
||||
|
||||
class connection
|
||||
class Connection
|
||||
{
|
||||
private $databaseName;
|
||||
private $databaseHost;
|
||||
@ -29,9 +29,10 @@ class connection
|
||||
$this->databasePassword,
|
||||
[
|
||||
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ
|
||||
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ,
|
||||
]
|
||||
);
|
||||
$this->databasePdo->exec("SET client_encoding TO 'utf8'");
|
||||
}
|
||||
|
||||
return $this->databasePdo;
|
||||
|
@ -2,6 +2,8 @@
|
||||
|
||||
namespace Portfolio\Configure\Routing;
|
||||
|
||||
use Portfolio\Configure\Database\Connection;
|
||||
|
||||
class Route
|
||||
{
|
||||
public $path;
|
||||
@ -30,7 +32,12 @@ class Route
|
||||
public function execute()
|
||||
{
|
||||
$params = explode('@', $this->action);
|
||||
$controller = new $params[0]();
|
||||
$controller = new $params[0](
|
||||
new Connection('portfolio',
|
||||
'127.0.0.1',
|
||||
'postgres',
|
||||
'postgres')
|
||||
);
|
||||
$method = $params[1];
|
||||
|
||||
if (isset($this->matches[1])) {
|
||||
|
@ -2,10 +2,17 @@
|
||||
|
||||
namespace Portfolio\Source\Design\Controller;
|
||||
|
||||
use Portfolio\Configure\Database\Connection;
|
||||
|
||||
class Base
|
||||
{
|
||||
protected string $layout = 'portfolio/template/base.html';
|
||||
|
||||
public function __construct(Connection $databaseConnection)
|
||||
{
|
||||
$this->databaseConnection = $databaseConnection;
|
||||
}
|
||||
|
||||
public function show(string $path, array $params = null): void
|
||||
{
|
||||
// Conversion du chemin en fichier HTML
|
||||
|
@ -2,17 +2,21 @@
|
||||
|
||||
namespace Portfolio\Source\Design\Controller\Home\Read;
|
||||
|
||||
use Portfolio\Configure\Database\Connection;
|
||||
use Portfolio\Source\Design\Controller\Base;
|
||||
|
||||
class Read extends Base
|
||||
{
|
||||
public function read(int $id)
|
||||
{
|
||||
$databaseConnection = new Connection('portfolio', '127.0.0.1', 'postgres', 'postgres');
|
||||
$requestDatabase = $databaseConnection->get_pdo()->query('SELECT * FROM Test');
|
||||
$requestDatabase = $this->databaseConnection->get_pdo()->query('SELECT * FROM Test');
|
||||
$test = $requestDatabase->fetchAll();
|
||||
var_dump($test);
|
||||
foreach ($test as $tests) {
|
||||
echo $tests->id;
|
||||
echo " - ";
|
||||
echo $tests->label;
|
||||
echo " <br> ";
|
||||
}
|
||||
|
||||
|
||||
return $this->show('home.read.read', ['id' => $id]);
|
||||
}
|
||||
|
@ -1,2 +1,26 @@
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
<header>
|
||||
<div id="logo">
|
||||
<h1>SERMAND Maxim</h1>
|
||||
</div>
|
||||
<button id="menu-toggle" aria-expanded="false">☰</button>
|
||||
<nav id="navbar">
|
||||
<ul>
|
||||
<li><a href="http://localhost/portfolio/" class="active">Accueil</a></li>
|
||||
<li><a href="http://localhost/portfolio/about/">À propos</a></li>
|
||||
<li><a href="http://localhost/portfolio/project/">Projets</a></li>
|
||||
<li><a href="http://localhost/portfolio/experience/">Expériences</a></li>
|
||||
<li><a href="http://localhost/portfolio/tech/">Veilles technologiques</a></li>
|
||||
<li><a href="http://localhost/portfolio/contact/">Contacts</a></li>
|
||||
<li class="theme-switch-wrapper">
|
||||
<label class="theme-switch">
|
||||
<input type="checkbox" id="theme-toggle">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
</main>
|
@ -1,2 +1,26 @@
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
<header>
|
||||
<div id="logo">
|
||||
<h1>SERMAND Maxim</h1>
|
||||
</div>
|
||||
<button id="menu-toggle" aria-expanded="false">☰</button>
|
||||
<nav id="navbar">
|
||||
<ul>
|
||||
<li><a href="http://localhost/portfolio/" class="active">Accueil</a></li>
|
||||
<li><a href="http://localhost/portfolio/about/">À propos</a></li>
|
||||
<li><a href="http://localhost/portfolio/project/">Projets</a></li>
|
||||
<li><a href="http://localhost/portfolio/experience/">Expériences</a></li>
|
||||
<li><a href="http://localhost/portfolio/tech/">Veilles technologiques</a></li>
|
||||
<li><a href="http://localhost/portfolio/contact/">Contacts</a></li>
|
||||
<li class="theme-switch-wrapper">
|
||||
<label class="theme-switch">
|
||||
<input type="checkbox" id="theme-toggle">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
</main>
|
@ -1,2 +1,26 @@
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
<header>
|
||||
<div id="logo">
|
||||
<h1>SERMAND Maxim</h1>
|
||||
</div>
|
||||
<button id="menu-toggle" aria-expanded="false">☰</button>
|
||||
<nav id="navbar">
|
||||
<ul>
|
||||
<li><a href="http://localhost/portfolio/" class="active">Accueil</a></li>
|
||||
<li><a href="http://localhost/portfolio/about/">À propos</a></li>
|
||||
<li><a href="http://localhost/portfolio/project/">Projets</a></li>
|
||||
<li><a href="http://localhost/portfolio/experience/">Expériences</a></li>
|
||||
<li><a href="http://localhost/portfolio/tech/">Veilles technologiques</a></li>
|
||||
<li><a href="http://localhost/portfolio/contact/">Contacts</a></li>
|
||||
<li class="theme-switch-wrapper">
|
||||
<label class="theme-switch">
|
||||
<input type="checkbox" id="theme-toggle">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
</main>
|
@ -23,5 +23,4 @@
|
||||
<main>
|
||||
<h1>Bienvenue sur mon portfolio</h1>
|
||||
<p>Voici la page d'accueil de l'application.</p>
|
||||
|
||||
</main>
|
@ -1,2 +1,26 @@
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
<header>
|
||||
<div id="logo">
|
||||
<h1>SERMAND Maxim</h1>
|
||||
</div>
|
||||
<button id="menu-toggle" aria-expanded="false">☰</button>
|
||||
<nav id="navbar">
|
||||
<ul>
|
||||
<li><a href="http://localhost/portfolio/" class="active">Accueil</a></li>
|
||||
<li><a href="http://localhost/portfolio/about/">À propos</a></li>
|
||||
<li><a href="http://localhost/portfolio/project/">Projets</a></li>
|
||||
<li><a href="http://localhost/portfolio/experience/">Expériences</a></li>
|
||||
<li><a href="http://localhost/portfolio/tech/">Veilles technologiques</a></li>
|
||||
<li><a href="http://localhost/portfolio/contact/">Contacts</a></li>
|
||||
<li class="theme-switch-wrapper">
|
||||
<label class="theme-switch">
|
||||
<input type="checkbox" id="theme-toggle">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
</main>
|
@ -1,2 +1,26 @@
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
<header>
|
||||
<div id="logo">
|
||||
<h1>SERMAND Maxim</h1>
|
||||
</div>
|
||||
<button id="menu-toggle" aria-expanded="false">☰</button>
|
||||
<nav id="navbar">
|
||||
<ul>
|
||||
<li><a href="http://localhost/portfolio/" class="active">Accueil</a></li>
|
||||
<li><a href="http://localhost/portfolio/about/">À propos</a></li>
|
||||
<li><a href="http://localhost/portfolio/project/">Projets</a></li>
|
||||
<li><a href="http://localhost/portfolio/experience/">Expériences</a></li>
|
||||
<li><a href="http://localhost/portfolio/tech/">Veilles technologiques</a></li>
|
||||
<li><a href="http://localhost/portfolio/contact/">Contacts</a></li>
|
||||
<li class="theme-switch-wrapper">
|
||||
<label class="theme-switch">
|
||||
<input type="checkbox" id="theme-toggle">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
</main>
|
@ -1,2 +1,26 @@
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
<header>
|
||||
<div id="logo">
|
||||
<h1>SERMAND Maxim</h1>
|
||||
</div>
|
||||
<button id="menu-toggle" aria-expanded="false">☰</button>
|
||||
<nav id="navbar">
|
||||
<ul>
|
||||
<li><a href="http://localhost/portfolio/" class="active">Accueil</a></li>
|
||||
<li><a href="http://localhost/portfolio/about/">À propos</a></li>
|
||||
<li><a href="http://localhost/portfolio/project/">Projets</a></li>
|
||||
<li><a href="http://localhost/portfolio/experience/">Expériences</a></li>
|
||||
<li><a href="http://localhost/portfolio/tech/">Veilles technologiques</a></li>
|
||||
<li><a href="http://localhost/portfolio/contact/">Contacts</a></li>
|
||||
<li class="theme-switch-wrapper">
|
||||
<label class="theme-switch">
|
||||
<input type="checkbox" id="theme-toggle">
|
||||
<span class="slider"></span>
|
||||
</label>
|
||||
</li>
|
||||
</ul>
|
||||
</nav>
|
||||
</header>
|
||||
<main>
|
||||
<h2>Détail de l'article</h2>
|
||||
<p>Identifiant : {{ id }}</p>
|
||||
</main>
|
Loading…
x
Reference in New Issue
Block a user