before() public method

Middleware function to check whether a user is logged on.
public before ( Request $request, Silex\Application $app, string $roleRoute = null ) : null | RedirectResponse | Symfony\Component\HttpFoundation\JsonResponse
$request Symfony\Component\HttpFoundation\Request The Symfony Request
$app Silex\Application The application/container
$roleRoute string An overriding value for the route name in permission checks
return null | Symfony\Component\HttpFoundation\RedirectResponse | Symfony\Component\HttpFoundation\JsonResponse
示例#1
0
 /**
  * Middleware function to check whether a user is logged on.
  *
  * @param Request            $request
  * @param \Silex\Application $app
  *
  * @return null|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function before(Request $request, Silex\Application $app, $roleRoute = null)
 {
     return parent::before($request, $app, 'extensions');
 }
示例#2
0
文件: Upload.php 项目: bolt/bolt
 /**
  * @param Request     $request
  * @param Application $app
  * @param null        $roleRoute
  *
  * @return null|\Symfony\Component\HttpFoundation\RedirectResponse
  */
 public function before(Request $request, Application $app, $roleRoute = null)
 {
     return parent::before($request, $app, 'files:uploads');
 }