/**
  * Setup the middleware your application will use.
  *
  * @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to setup.
  * @return \Cake\Http\MiddlewareQueue The updated middleware.
  */
 public function middleware($middleware)
 {
     $middleware->add(new ErrorHandlerMiddleware(Configure::read('Error.exceptionRenderer')))->add(new AssetMiddleware())->add(new RoutingMiddleware());
     $middleware->push(new LanguageSwitcherMiddleware(Configure::read('LanguageSwitcher.Middleware')));
     $middleware->push(new \ADmad\Glide\Middleware\GlideMiddleware(Configure::read('Glide')));
     return $middleware;
 }
Beispiel #2
0
 /**
  * Setup the middleware your application will use.
  *
  * @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to setup.
  * @return \Cake\Http\MiddlewareQueue The updated middleware.
  */
 public function middleware($middleware)
 {
     $middleware->add(new AssetMiddleware())->add(new RoutingMiddleware())->add(new LocaleSelectorMiddleware(['locales' => ['en_US', 'en', 'fr_FR', 'fr']]));
     return $middleware;
 }
 /**
  * Setup the middleware your application will use.
  *
  * @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to setup.
  * @return \Cake\Http\MiddlewareQueue The updated middleware.
  */
 public function middleware($middleware)
 {
     $middleware->add(new ErrorHandlerMiddleware(Configure::read('Error.exceptionRenderer')))->add(new AssetMiddleware())->add(new RoutingMiddleware());
     return $middleware;
 }