-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correctifs mineur sur l'ajout d'une page Database pour l'exemple
- Loading branch information
Showing
14 changed files
with
117 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
namespace App\Controllers; | ||
|
||
class DbController extends \BDSCore\BaseController | ||
{ | ||
|
||
/** | ||
* @var \App\Models\dbModel | ||
*/ | ||
private $app; | ||
|
||
/** | ||
* DbController constructor. | ||
* @param \Psr\Http\Message\RequestInterface $request | ||
* @param \Psr\Http\Message\ResponseInterface $response | ||
*/ | ||
public function __construct(\Psr\Http\Message\RequestInterface $request, \Psr\Http\Message\ResponseInterface $response) { | ||
parent::__construct($request, $response); | ||
|
||
$this->app = new \App\Models\DbModel(); | ||
} | ||
|
||
/** | ||
* @return void | ||
*/ | ||
public function index() { | ||
$this->render('db.twig', [ | ||
'bookmarks' => $this->app->bookmarkList() | ||
]); | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
/** | ||
* Class DbModel | ||
* @package App\Models | ||
*/ | ||
class DbModel | ||
{ | ||
|
||
/** | ||
* @var \BDSCore\Database\Database | ||
*/ | ||
private $database; | ||
|
||
/** | ||
* DbModel constructor. | ||
*/ | ||
public function __construct() { | ||
$this->database = new \BDSCore\Database\Database(); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function bookmarkList() { | ||
$sql = 'SELECT id, url, nom FROM bookmark ORDER BY id ASC'; | ||
$result = $this->database->fetchAll($sql); | ||
|
||
return $result; | ||
} | ||
|
||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,8 +8,5 @@ | |
*/ | ||
class DatabaseException extends \Exception | ||
{ | ||
public function test() | ||
{ | ||
return 'ERROR CONNEXIOn DATABASE'; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
|
||
/* | ||
BDS Framework, For example only | ||
*/ | ||
|
||
CREATE DATABASE framework; | ||
|
||
CREATE TABLE bookmark | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
|
||
/* | ||
BDS Framework, For example only | ||
*/ | ||
|
||
CREATE DATABASE framework | ||
WITH OWNER = stephane | ||
ENCODING = 'UTF8' | ||
|