<?php
function pre($url, $str){
echo "<pre style='background:#f1f1f1;border:1px solid #b1b1b1;padding:10px;margin:10px 0;'>$url\n\r".print_r($str, true)."</pre>";
}
//Include ROUTE CLASS:
include dirname(__FILE__).'routeclass.php';
Route::$request[] = array(
array(
'request' => '/',
'action' => 'index',
'test' => 'go' // an additional parameter
),
array(
'request' => '/<lang>/catalog(/<test>)', // key url section
'action' => 'catalog_review'
),
array(
'request' => '/news(/page/<pagination>|/<page>)', // key url section
'action' => 'news',
),
array(
'request' => '/<lang>/<action>', // key url section
'action' => 'page' // default action in url
),
'controller' => 'main',
'param' => array(
'lang' => '[a-z]{2}', // regex url parametr <lang>
'action' => '(contact|servise|go|[a-z]{5,25})', // regex url parametr <action>
'page' => '[a-z0-9_\-]{5,25}',
'pagination' => '[0-9]{1,2}',
'year' => '[0-9]{4}'
)
);
pre('/', Route::matchURI('') );
pre('/ru/import', Route::matchURI('/ru/import') );
pre('/ru/go', Route::matchURI('/ru/go') );
pre('/ru/catalog', Route::matchURI('/ru/catalog') ); // OR /ru/catalog/additional_parameter
pre('/news/page/23', Route::matchURI('/news/page/23') );
pre('/news/title_news', Route::matchURI('/news/title_news') );
|