Fat Free Framework 入门错误
我已经使用 无脂肪框架 创建了第一个 .php 文件,但它不起作用
文件内容:
<?php
require_once("../fatfree/lib/base.php");
F3::route('GET /','home');
function home()
{
echo 'Hello, world!';
}
F3::run();
?>
I'我收到 404 错误
I've create a first .php file with fat free framework but it is not working
Contents of file:
<?php
require_once("../fatfree/lib/base.php");
F3::route('GET /','home');
function home()
{
echo 'Hello, world!';
}
F3::run();
?>
I'm getting a 404 error
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
路由引擎不能调用这样的松散函数。您应该使您的函数成为这样的类的方法:
或者将您的 home 函数变成像这样的匿名函数:
The routing engine can't call loose functions like that. You should either make your function a method of a class like this:
OR turn your home function into an anonimous function like this: