http://localhost/kohana32/index.php/c/welcome/index.html/3.html
项目路径:\kohana32\application\classes\Controller\Welcome.php
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Welcome extends Controller {
function action_index(){
echo $this->request->param('area');
}
} // End Welcomebootstrap.php
Route::set('default','(<area>(/<controller>(/<action>(.html)(/<id>))))(.html)')
->defaults(array(
'area'=> 'nj',
'controller' => 'welcome',
'action' => 'index'
));
本文介绍了Kohana框架中路由设置及控制器的具体实现方式。通过一个具体的示例展示了如何定义默认路由并设置参数,默认控制器为Welcome,同时演示了如何在控制器中获取URL参数。
34

被折叠的 条评论
为什么被折叠?



