Erster Stand des mvc-Frameworks
This commit is contained in:
62
rendering/Route/FrontendRoute.php
Normal file
62
rendering/Route/FrontendRoute.php
Normal file
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
/**
|
||||
* Standard RouteHandler
|
||||
* Instanziiert den Standard Controller
|
||||
* @author Christian Steinle
|
||||
* @date 03.08.2016
|
||||
*
|
||||
* @copyright CS medien- & kommunikationssysteme (http://www.steinle-computer.de)
|
||||
*/
|
||||
|
||||
namespace Route;
|
||||
|
||||
use Controller\FrontendController;
|
||||
|
||||
|
||||
class FrontendRoute
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected $route = '';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $routeParts = array();
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected $request = array();
|
||||
|
||||
protected $controller = null;
|
||||
|
||||
protected $action = '';
|
||||
|
||||
|
||||
/**
|
||||
* FrontendRoute constructor.
|
||||
* @param string $route
|
||||
* @param array $request
|
||||
*/
|
||||
public function __construct($route, array $request = array())
|
||||
{
|
||||
$this->setRoute($route);
|
||||
$this->request = $request;
|
||||
$this->controller = new FrontendController($this->route, $request);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param string $route
|
||||
*/
|
||||
private function setRoute($route)
|
||||
{
|
||||
$this->route = trim($route, " \t\n\r\0\x0B/");
|
||||
$this->routeParts = explode('/', $this->route);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user