$fileLocator = new FileLocator(array(__DIR__));
$loader = new YamlFileLoader($fileLocator);
$routes = $loader->load('routes.yaml');
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Routing\Loader\YamlFileLoader;
use Symfony\Component\Routing\RouteCollectionBuilder;
require_once __DIR__.'/../vendor/autoload.php';
$locator = new FileLocator([__DIR__.'/../data']);
$loader = new YamlFileLoader($locator);
$builder = new RouteCollectionBuilder($loader);
$builder->import('dir1/routes.yaml');
$builder->import('dir2/routes.yaml');
$routes = $builder->build();
var_dump($routes);
use Symfony\Component\Config\FileLocator;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\Routing\Loader\GlobFileLoader;
use Symfony\Component\Routing\Loader\YamlFileLoader;
use Symfony\Component\Routing\RouteCollectionBuilder;
require_once __DIR__.'/../vendor/autoload.php';
$locator = new FileLocator([__DIR__.'/../data']);
$resolver = new LoaderResolver([
new GlobFileLoader($locator), // needs symfony/finder
new YamlFileLoader($locator),
]);
$loader = new DelegatingLoader($resolver);
$builder = new RouteCollectionBuilder($loader);
$builder->import('**/*/routes.yaml', '/', 'glob');
$routes = $builder->build();
var_dump($routes);