Php 无脂肪框架:F3自动装弹机

Php 无脂肪框架:F3自动装弹机,php,fat-free-framework,Php,Fat Free Framework,我正在学习无脂肪框架,但我遇到了一个问题 我试用了F3自动装弹机,得到了: Internal Server Error Fatal error: Class 'Gadgets\iPad' not found 在index.php中,我写了: $f3->set('AUTOLOAD','autoload/'); $obj=new Gadgets\iPad; 并创建了一个名为Gadgets的文件夹,其中包含一个名为ipad.php 在文件中我放了一个类 <?php namesp

我正在学习无脂肪框架,但我遇到了一个问题

我试用了F3自动装弹机,得到了:

Internal Server Error
Fatal error: Class 'Gadgets\iPad' not found
index.php
中,我写了:

$f3->set('AUTOLOAD','autoload/');
$obj=new Gadgets\iPad;
并创建了一个名为
Gadgets
的文件夹,其中包含一个名为
ipad.php

在文件中我放了一个类

<?php
    namespace Gadgets;
    class iPad {}
?>


这取决于您的操作系统,但您必须注意大小写。如果您将
ipad.php
重命名为
ipad.php

F3检查类名是否正常,然后再次检查自动加载中每个路径的小写。该行为在3.1.2中进行了调整,因此如果使用3.1.1,可能会出现问题。下面是base.php中的代码片段:

is_file($file=$auto.$class.'.php') ||
is_file($file=$auto.strtolower($class).'.php') ||
is_file($file=strtolower($auto.$class).'.php'))
您的示例不起作用,因为它既不是正确的大小写(“Gadgets/iPad.php”),也不是所有小写(“Gadgets/iPad.php”)