{{{
use \lithium\net\http\Router;
use \app\extensions\route\Locale;
}}}Uncomment the line below to enable routing for admin actions.
{{{
// Router::namespace('/admin', array('admin' => true));
Router::connect(new Locale(array(
'template' => '/cmd/{:args}',
'params' => array(
'controller' => 'command', 'action' => 'command'
)
)));
Router::connect(new Locale(array(
'template' => '/presents',
'params' => array(
'controller' => 'pages', 'action' => 'view', 'args' => array('presents')
)
)));
}}}Here, we are connecting '/' (base path) to controller called 'Pages', its action called 'view', and we pass a param to select the view file to use (in this case, /app/views/pages/home.html.php)...
{{{
Router::connect(new Locale(array(
'template' => '',
'params' => array(
'controller' => 'pages', 'action' => 'view'
)
)));
}}}Finally, connect the default routes.
{{{
Router::connect(new Locale(array(
'template' => '/{:controller}/{:action}/{:id:[0-9]+}.{:type}',
'params' => array('id' => null)
)));
Router::connect(new Locale(array(
'template' => '/{:controller}/{:action}/{:id:[0-9]+}',
)));
Router::connect(new Locale(array(
'template' => '/{:controller}/{:action}/{:args}',
)));
}}}