【发布时间】:2013-12-13 22:04:37
【问题描述】:
您好,我希望能够重写我的网址。我有这种格式的网址:
localhost/example/urlrewriting/Links/view/1
我想把这个网址改成
http://localhost/example/urlrewriting/tt/my-link-1
在我的 Routes.php 中我已经这样做了:
Router::connect('tt/:slug-:id',
array('controller' =>'links', 'action' => 'test'),
array('pass' => array('slug', 'id'), 'slug' => '[a-z0-9\-]+', 'id' => '[0-9]+'));
在我的控制器中我有这个
public function test($param1, $param2){
debug($this->request->params);
}
我总能找到这个答案:
TtController could not be found.
cakephp 2.4.1
【问题讨论】:
标签: cakephp url-rewriting routes