2012-07-02 18 views
0

我有一個TinyMVC的問題。我對這個「MVC框架」很感興趣。爲什麼TinyMVC沒有加載控制器?

我在這裏下載TinyMVC的最後一個版本:http://www.tinymvc.com/download/

我只是跟着引導和我已經到達控制器文檔上:http://www.tinymvc.com/documentation/index.php/Documentation:Controllers

我跟着指示,我創建了一個hello.php文件內部的myapp /控制器/ hello.php

這是hello.php的代碼

class Hello_Controller extends TinyMVC_Controller 
{ 
    function index() 
    { 
    echo "Hello World."; 
    } 
    function time() 
    { 
    echo "The time is now."; 
    } 
} 

我也把這個的.htaccess內htdocs目錄(其中的index.php是)

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php/$1 [L] 

現在的問題是,似乎tinyMVC沒有正確加載的控制器。

我只是想:

http://localhost/myproject/www (AND I SEE THE DEFAULT CONTROLLER correctly) 

http://localhost/myproject/www/hello (I STILL SEE THE DEFAULT CONTROLLER) 

http://localhost/myproject/www/hello/time (I get the follow error) 

Error: 0 
Message: Unknown controller method 'time' 
File: C:\xampp\htdocs\myproject\tinymvc\sysfiles\plugins\tinymvc_controller.php 
Line: 58 

我不知道這是錯誤的事情,但我的控制器不正確。

+0

嘗試SVN版本,它有更多的修復http://stackoverflow.com/a/12170022/685107 – tijagi

回答

1

TinyMVC.php中有188行存在問題。

變化file_exists到stream_resolve_include_path(文件位於tinymvc/sysfiles/

相關問題