How to changes the default URL format in kohana 3.2.
base/news/news_details to news/
Route::set('news_tracking2', 'news/news_details')
->defaults(array('controller' => 'news','action' => 'index','method' => NULL));
How to changes the default URL format in kohana 3.2.
base/news/news_details to news/
Route::set('news_tracking2', 'news/news_details')
->defaults(array('controller' => 'news','action' => 'index','method' => NULL));
You mix the concepts. There is a routing that translates the incoming URL into Request::controller-action
(1). And generate links for HTML (2).
1: For routes:
Route::set('second', 'awesome_news_prefix(/<id>(/<offseet>))', array('offset' => '[1-9]\d*(\.\d+)?'))
->defaults(array(
'controller' => 'news',
'action' => 'index',
'id' => NULL,
'offset' => NULL,
));
Route::set('default', '(<controller>(/<action>(/<id>(/<offseet>))))', array('controller' => '[a-z][^/\.]+', 'offset' => '[1-9]\d*(\.\d+)?'))
->defaults(array(
'controller' => 'news',
'action' => 'index',
'id' => NULL,
'offset' => NULL,
));
link generation
URL::site(Route::get('default')->uri(array('id' => 1)));
give result: http://example.com/news/index/1
URL::site(Route::get('second')->uri(array('id' => 1)));
give result: http://example.com/awesome_news_prefix/1