PHP:
скопировать код в буфер обмена
скопировать код в буфер обмена
- <?
- class Router{
- function __construct(){
- }
- function run(){
- $controller = !empty($this->_query[0]) ? ucfirst(strtolower($this->_query[0])) . 'Controller' : 'IndexController';
- $parameters = $this->_query;
- $controller = 'ErrorController';
- $action = '_404';
- }
- $controller = new $controller($this);
- $controller->$action($parameters[2],$parameters[3],$parameters[4]);
- }
- }
- function setLayout($layout){
- $this->_layout = $layout;
- }
- function getLayout(){
- echo $this->_layout;
- }
- }
- ?>