Ejemplo n.º 1
0
 /**
  * Creates a new instance of ApplicationRouter class and defines standard application routes
  * @param boolean $defaultRoutes
  */
 public function __construct($defaultRoutes = false)
 {
     parent::__construct($defaultRoutes);
     $this->removeExtraSlashes(true);
     /**
      * Controller and action always default to 'index' 
      */
     $this->setDefaults(['controller' => 'index', 'action' => 'index']);
     /**
      * Add global matching route for the default module 'Backend': 'default-route'
      */
     $this->add('/', ['module' => 'admin', 'namespace' => 'App\\Modules\\Admin\\Controllers\\'])->setName('default-route');
     /**
      * Add default not found route
      */
     $this->notFound(['controller' => 'index', 'action' => 'route404']);
 }