在遵循这段代码时
$f3=require('lib/base.php');
$f3->route('GET /brew/@count',
function($f3) {
echo $f3->get('PARAMS.count').' bottles of beer on the wall.';
}
);
$f3->run();
来自https://github.com/bcosca/fatfree#routing-engine上的 Fat-Free Framework 示例,我在浏览器中收到此错误:
Internal Server Error
Missing argument 1 for {closure}()
* /var/www/f3/index.php:36 Base->{closure}
* /var/www/f3/lib/base.php:972
* Base->call(Closure::__set_state(),NULL,'beforeroute,afterroute')
* /var/www/f3/index.php:40 Base->run()
我知道问题是 $f3 没有作为参数传递给函数,但我不明白为什么。有谁能够帮我?