\modules\test\init.php
<?php defined('SYSPATH') or die('No direct script access.');
// Static file serving (CSS, JS, images)
/*
当前url: /index.php/a/1
原始url: /index.php/test/test
*/
/*
Route::set('a', 'a(/<controller>(/<action>))')
->defaults(array(
'controller' => 'test1',
'action' => 'index'
));
*/
Route::set('a', function($uri)
{
if ($uri == 'a/1')
return array(
'controller' => 'test',
'action' => 'index',
);
},
'a/1'
);
\modules\test\classes\controller\test.php
<?php defined('SYSPATH') or die('No direct script access.');
/**
* Kohana user guide and api browser.
*
* @package Kohana/Userguide
* @category Controllers
* @author Kohana Team
*/
class Controller_Test extends Controller_Template {
public function before()
{
parent::before();
}
// List all modules that have userguides
public function action_index()
{
echo 'test';
exit;
}
} // End Userguide