Silex Setting Middleware to a ControllerCollection -
i want this:
$app->mount('dashboard', new travel\controllers\dashboard())->before(function() use ($app) { //check if logued... })
is possible?
thanks!
you can
$controllers = $app["controllers_factory"]; $controllers->before(function(request $request){});
in controllerproviderinterface::connect
method
if need function defined in $app
definition php file can create protected function
$app['callback'] = $app->protect(function(){});
then
$controllers->before($app["callback"]);
Comments
Post a Comment