<?php include ("UrlManager.php"); include ("Url.php");
$ROUTES['view_articles'] = array( "url" => "/<lang>/article/<title>", "rules" => array( "lang" => "([a-z]{0,2})", "title" => "([a-z0-9\-\_]+)" ), "mounts" => array( "controller" => "Frontend_Cms", "action" => "view_article", "exec" => "view_article" ) );
$ROUTES['manager_admin'] = array( "url" => "cms/admin:*", "rules" => array(), "mounts" => array( "controller" => "CmsAdmin", "action" => "init" ) );
$ROUTES['manager_language'] = array( "url" => 'cms/language:*', "rules" => array(), "mounts" => array('controller' => 'CmsLanguage', 'action' => 'init') );
foreach ($ROUTES as $key => $route) { UrlManager::init()->append_route($key, $route); }
$wanted_url = 'cms/language';
$url = UrlManager::init()->get_match($wanted_url);
print_r($url);
echo "<br>"; echo UrlManager::init()->get_route('view_articles')->assemble(array('lang' => 'hr', 'title' => 'mladenovich', 'rest' => '?additional_parameter=1'));
?>
|