src/MVC/MVC.php
public function setRoutes()
    {
        $routesJsonFile = $this->getAppDir() . '/config/routes.json';
        $routesPhpFile = $this->getAppDir() . '/config/routes.php';
        $routes = array();

        if (file_exists($routesJsonFile)) {
            $routes[] = json_decode(file_get_contents($routesJsonFile), true);
        } elseif (file_exists($routesPhpFile)) {
            $routes[] = require_once $routesPhpFile;
        }

        foreach ($this->container->getModules() as $module) {
            $extension = $module->getModuleExtension();
            if (is_object($extension) && $extension instanceof Injection\Extension) {
                $routes[] = $extension->loadRoutes();
            }
        }

        return $routes;
    }
public function setRoutes()
    {
        $routesJsonFile = $this->getAppDir() . '/config/routes.json';
        $routesPhpFile = $this->getAppDir() . '/config/routes.php';
        $routes = array();

        if (file_exists($routesJsonFile)) {
            $routes[] = json_decode(file_get_contents($routesJsonFile), true);
        } elseif (file_exists($routesPhpFile)) {
            $routes[] = require_once $routesPhpFile;
        }

        foreach ($this->container->getModules() as $module) {
            $extension = $module->getModuleExtension();
            if (is_object($extension) && $extension instanceof Injection\Extension) {
                $routes[] = $extension->loadRoutes();
            }
        }

        return $routes;
    }
public function setRoutes ( ) { $ routesJsonFile = $ this -> getAppDir ( ) . '/config/routes.json' ; $ routesPhpFile = $ this -> getAppDir ( ) . '/config/routes.php' ; $ routes = array ( ) ; if ( file_exists ( $ routesJsonFile ) ) { $ routes [ ] = json_decode ( file_get_contents ( $ routesJsonFile ) , true ) ; } elseif ( file_exists ( $ routesPhpFile ) ) { $ routes [ ] = require_once $ routesPhpFile ; } foreach ( $ this -> container -> getModules ( ) as $ module ) { $ extension = $ module -> getModuleExtension ( ) ; if ( is_object ( $ extension ) && $ extension instanceof Injection \ Extension ) { $ routes [ ] = $ extension -> loadRoutes ( ) ; } } return $ routes ; }
Set Routes from JSON|PHP File

@return Route[]
Set Routes from JSON|PHP File