From bd20965314da58dd81a19ed20e9b539b7045257a Mon Sep 17 00:00:00 2001 From: vincent-peugnet Date: Sat, 17 Mar 2018 22:15:58 +0100 Subject: class stables --- public/w/index.php | 56 +++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 41 insertions(+), 15 deletions(-) (limited to 'public/w') diff --git a/public/w/index.php b/public/w/index.php index 85c0902..4d28510 100644 --- a/public/w/index.php +++ b/public/w/index.php @@ -8,7 +8,7 @@ require('fn/fn.php'); require('class/class.art.php'); require('class/class.app.php'); $config = include('config.php'); -$app = new App(); +$app = new App($config); session(); @@ -26,6 +26,25 @@ head('article'); // 'datemodif' => new DateTimeImmutable(null, timezone_open("Europe/Paris")) // ]); +$arraytest = ([ + 'id' => 'articlet2', + 'titre' => 'titre', + 'soustitre' => 'soustitre', + 'intro' => 'intro', + 'tag' => 'sans tag,', + 'datecreation' => '2018-03-17 18:31:34', + 'datemodif' => '2018-03-17 18:31:34', + 'css' => 'display: inline:', + 'html' => 'coucou les loulous', + 'secure' => 0, + 'couleurtext' => '#000000', + 'couleurbkg' => '#ffffff', + 'couleurlien' => '#2a3599' +]); + +// $art = new Art($arreytest); + + // echo '
';
 // print_r($art);
 // print_r($app);
@@ -37,25 +56,32 @@ head('article');
 // echo '

article exist :' . $app->exist('articlet') . '

'; // var_dump($app->exist('articlet')); -// $app->get('articlet'); -// echo '
';
-// print_r($art);
-// print_r($app);
-// echo '
'; -try { - $bdd = new PDO('mysql:host=localhost;dbname=wcms;charset=utf8', 'root', ''); -} catch (Exeption $e) { - die('Erreur : ' . $e->getMessage()); -} +echo '
';
+$art = $app->get('articlet');
+
+var_dump($art);
+
+echo 'count : ' . $app->count();
+
+ var_dump($app->exist('bouffffe'));
+ var_dump($app->exist('bouffe'));
+
+
+ $art2 = new Art($arraytest);
+
+//  $app->add($art2);
+
+$app->update($art2);
+
+var_dump($app->getlist());
+
+echo '
'; + -$q = $bdd->query('SELECT * FROM art WHERE id = articlet'); -$donnees = $q->fetch(); -var_dump($donnees); -$q = closeCursor(); -- cgit v1.2.3