解决方法
这在
cookbook中有详细记载.
更新:http://book.cakephp.org/2.0/en/development/routing.html#file-extensions
To handle different file extensions with your routes,you need one
@H_404_12@
extra line in your routes config file:Router::parseExtensions('html','RSS');If you want to create a URL such as /page/title-of-page.html you would
@H_404_12@
create your route as illustrated below:Router::connect( '/page/:title',array('controller' => 'pages','action' => 'view'),array( 'pass' => array('title') ) );Then to create links which map back to the routes simply use:
@H_404_12@$this->Html->link( 'Link title','action' => 'view','title' => 'super-article','ext' => 'html') );