I'm trying to create the above mentioned route... year, month, day and title should be passed to the method.
Any idea how that works?
Thanks i开发者_Python百科n advance!
You have to create an additional route in application/bootstrap.php
:
Route::set('post', 'post/<year>/<month>/<day>/<title>', array('year'=>'\d{4}', 'month'=>'\d{2}', 'day'=>'\d{2}'))
->defaults(array(
'controller' => 'post',
'action' => 'index',
));
Then inside your controller (in this example, Controller_Post), you put this method:
public function action_index($year, $month, $day, $title){
//Your code here
}
精彩评论