2
在https://github.com/bcosca/fatfree#routing-engine繼起無脂肪框架示例代碼無脂肪框架中缺失的參數1 {關閉}()
$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();
這一點,而我在我的瀏覽器中得到這個錯誤:
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沒有被傳遞到函數作爲參數,但我不明白爲什麼。有誰能夠幫助我?