Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
| Total | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
CRAP | |
0.00% |
0 / 12 |
| App\Controllers\DetailViewController | |
0.00% |
0 / 1 |
|
0.00% |
0 / 2 |
6 | |
0.00% |
0 / 12 |
| __construct | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 5 |
|||
| detailTemplateAction | |
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 7 |
|||
| <?php | |
| namespace App\Controllers; | |
| use \Core\View; | |
| use App\Models\ArticleDatabase; | |
| class DetailViewController extends \Core\Controller { | |
| protected $article; | |
| protected $id; | |
| private $articleDatabase; | |
| public function __construct($route_params) { | |
| parent::__construct($route_params); | |
| $this->articleDatabase = new ArticleDatabase(); | |
| $this->id = $route_params['id']; | |
| $this->article = $this->articleDatabase->findByID($this->id); | |
| } | |
| /** | |
| * Show the Detail(Article) page | |
| * | |
| * @return void | |
| */ | |
| public function detailTemplateAction() { | |
| View::renderTemplate( | |
| 'detailTemplate.twig', array("name" => "Detail Seite", | |
| "link" => "Warenkorb", | |
| "article" => $this->article | |
| ) | |
| ); | |
| } | |
| } |