将Employee.php类放在与index.php相同的目录中时,每件事情都可以正常工作
的index.php:
<?php
$f3=require('lib/base.php');
$f3->config('config.ini');
$f3->map('/employee','Employee');
$f3->run();
将Employee.php类放在目录下,app用于检查并运行以下index.php
<?php
$f3=require('lib/base.php');
$f3->config('config.ini');
$f3->map('/employee','app\Employee');
$f3->run();
我收到错误
内部服务器错误
致命错误:无法重新声明类Employee
•/ home / zaky /Development/kinder/app/Employee.php:2
Employee.php:
<?php
class Employee{
function get() {die("get---");}
function post() {die("post---");}
function put() {die("put---");}
function delete() {die("delete---");}
}