<?php $request = 'news-2'; 'news-([0-9])' => 'index/news/id/$1', 'pokaz' => 'index/news', ); foreach($route as $r => $key) { } }
<?php $request = 'news-2'; 'news-([0-9])' => 'index/news/id/$1', 'pokaz' => 'index/news', ); foreach($route as $r => $key) { } }
public function method($args) { }
<?php namespace Lib; use Lib\Config; class Request { //vars define private $_controller; private $_action; public function __construct() { //route from config '\\/home' => 'index/index', //controller index, action: index ); foreach($route as $r => $key) { break; } } //end config route //param for($i=0;$i<count($parts);$i=$i+2) { } //args } public function getController() { } public function getAction() { } public function getParam($name=null) { return $this->_args[$name]; } } public function goUrl($url) { } }