2
我想要做這樣的事情:Silex的設置中間件到ControllerCollection
$app->mount('dashboard', new Travel\Controllers\Dashboard())->before(function() use ($app) {
//check if is logued...
})
這可能嗎?
謝謝!
我想要做這樣的事情:Silex的設置中間件到ControllerCollection
$app->mount('dashboard', new Travel\Controllers\Dashboard())->before(function() use ($app) {
//check if is logued...
})
這可能嗎?
謝謝!
,你可以在你做
$controllers = $app["controllers_factory"];
$controllers->before(function(Request $request){});
ControllerProviderInterface::connect
方法
,如果您需要在$app
定義PHP文件中定義的函數,你可以創建一個受保護的功能
$app['callback'] = $app->protect(function(){});
然後
$controllers->before($app["callback"]);
是的,工作正常,謝謝! – Gabriel 2013-04-05 20:33:44