2014-09-28 104 views
0

我开始使用Kohana开发,我不明白为什么我有这样的错误...的Kohana 3.3.2控制器在子文件夹

Kohana_HTTP_Exception [ 404 ]: The requested URL api/v1/welcome was not found on this server. 

SYSPATH/classes/Kohana/Request/Client/Internal.php [ 89 ] 

if (! class_exists($prefix.$controller)) 
{ 
    throw HTTP_Exception::factory(404, 
    'The requested URL :uri was not found on this server.', 
    array(':uri' => $request->uri()) 
    )->request($request); 
} 

// Load the controller using reflection 
$class = new ReflectionClass($prefix.$controller); 

我的.htaccess

# Turn on URL rewriting 
RewriteEngine On 

# Installation directory 
RewriteBase/

# Protect hidden files from being viewed 
<Files .*> 
    Order Deny,Allow 
    Deny From All 
</Files> 

# Protect application and system files from being viewed 
RewriteRule ^(?:application|modules|system)\b.* index.php/$0 [L] 

# Allow any files or directories that exist to be displayed directly 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 

# Rewrite all other URLs to index.php/URL 
RewriteRule .* index.php/$0 [PT] 

我的路线

Route::set('api','api/v1(/<controller>(/<id>)(/<custom>))' 
)->defaults(
    array(
     'directory' =>'api/v1', 
     'controller' => 'welcome', 
     'id'   => FALSE, 
     'action'  => 'index', 
    ) 
); 

我的控制器:控制器/ API/V1 /的welcome.php

<?php defined('SYSPATH') or die('No direct script access.'); 

class Controller_Api_v1_Welcome extends Controller { 

    public function action_index() 
    { 
     $this->response->body('hello, world!'); 
    } 
} // End Welcome 

我这么想???为什么我的控制器类上的class_exist返回FALSE?现在

回答

0

的Kohana 3.3.2 =>整个代码是区分大小写的

Route::set('api','api/v1(/<controller>(/<id>)(/<custom>))' 
)->defaults(
    array(
     'directory' =>'Api/V1', 
     'controller' => 'Welcome', 
     'id'   => FALSE, 
     'action'  => 'index', 
    ) 
); 
+1

感谢名单了很多,你让我很快乐! – Eupho 2014-09-29 09:20:53