我正在学习 kohana,我正在使用 ver:3.3.0。
我收到此错误:
Kohana_HTTP_Exception [ 404 ]: The requested URL calendar was not found on this server.
SYSPATH\classes\Kohana\Request\Client\Internal.php [ 79 ]
SYSPATH\classes\Kohana\Request\Client\Internal.php [ 79 ]
SYSPATH\classes\Kohana\Request\Client.php [ 114 ] » Kohana_Request_Client_Internal->execute_request(arguments)
SYSPATH\classes\Kohana\Request.php [ 990 ] » Kohana_Request_Client->execute(arguments)
DOCROOT\index.php [ 118 ] » Kohana_Request->execute()
我输入的网址:
(//localhost/organizer_tst/calendar/)
我的文件:
应用程序\类\控制器\日历\Calendar.php:
class Controller_Calendar extends Controller
{
public function action_index()
{
$tst = new Model_Calendar();
echo $tst->testing("LOLLOLOOLL");
}
}
应用程序\类\模型\日历.php:
Class Model_Calendar extends Model
{
public function testing($param)
{
$tst ="I want to display it: "."$param";
return $tst ;
}
}
引导程序.php:
Kohana::init(array(
'base_url' => '/organizer_tst/',
));
Route::set('something', 'calendar(/<directory>(/<controller>(/<action>(/<id>))))')
->defaults(array(
'directory' => 'Calendars',
'controller' => 'Calendar',
'action' => 'index',
));
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'welcome',
'action' => 'index',
));
我在错误页面上检查了“环境->包含的文件”我可以看到我的控制器文件:APPPATH\classes\Controller\Calendars\Calendar.php
在这种情况下,如果 Controller 不在额外目录中,则一切正常: application\classes\Controller\Calendars\Calendar.php
我使用 Xampp 我的根目录:D:\xampp\htdocs 并且我的项目有别名: Alias /organizer_tst/calendar "D:\xampp\htdocs\organizer_tst"
你能告诉我为什么我有这个错误异常吗?