| 12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- namespace Tools;
- /**
- * Controller abstract class
- **/
- abstract class AController
- {
- /**
- * @var array $params
- * Contains route parameter
- * ex: /product/:id will contains {
- * 0 => product
- * 1 => [ID]
- * ':id' => [ID]
- **/
- protected $params;
- /**
- * @var \Tools\Context $context
- **/
- protected $context;
- /**
- * @param \Tools\Context $context
- * @param array $params
- * @throws \Exception\Error404 if parameters does not correspond
- * On 404 error, router will try to find another route
- * Initialize structure
- **/
- public function __construct($context, $params)
- {
- $this->params = $params;
- $this->context = $context;
- }
- /**
- * Fullfill Controller's request
- **/
- public abstract function start();
- }
|