Atm i am trying to migrate php code
$routes->add(
'index',
new Route('/', ['_controller' => 'getIndex'])
);
to YML config
index:
path: /
defaults: { _controller: 'getIndex' }
but i am getting an error
'There is no extension able to load the configuration for "index" (in /app/config\routes.yml).
YamlFileLoade just cant read this type of config, but why? I am using this guide http://symfony.com/doc/current/components/routing/introduction.html and my code to load configurations
$config = array(__DIR__ . '/app/config');
$loader = new YamlFileLoader($container, new FileLocator($config));
$loader->load('master.yml');
$collection = $loader->load('routing.yml');
already working perfectly with service container (master.yml) but doesnt with routings configuration.
app/config/routing.ymlor in added bundles. <-- That's for Symfony, ignore this~Symfony\Component\Routing\Loader\YamlFileLoader)? Also your$loader->load('master.yml')doesn't match yourroutes.ymlfilename.