Route::set('category', 'category/date/<id>(/<year>)', array('id' => '[0-9]+', 'year' => '[0-9]+'))
->defaults(array(
'controller' => 'category',
'action' => 'date',
));
kohana 3.2路線上的參數是否有上限?最大。 kohana路線上的參數
我在自舉中實現了這條路線,但每次嘗試通過year
值時我都會收到404錯誤!
單獨傳遞身份證即可正常工作。
我錯過了什麼嗎?
這是處理該路由的控制器操作:
public function action_date() {
$id = $this->request->param('id');
$year = $this->request->param('year');
if(!isset($year) && $year == ""){
$year = date("Y", time());
}
//Do fancy stuff here... and hand it to the view!
}
請給出一個示例你試圖請求。 – Darsstar 2011-12-21 18:49:21
http://domain.com/category/date/3/2011 – FMK 2012-01-12 22:05:32