1
votes

this is my very first time with Symfony, so im trying to make a simple routing inclusion. This is what it have:

app/AppKernel

public function registerBundles()
    {
        $bundles = array(
           .
           .
           .
            new WSBundle\WSBundle()
        );

app/config/routing.yml

.
.
.
ws_tiposdivisionmenor:
        resource: "@WSBundle/Resources/config/routing.yml"
        prefix:   /

src/WSBundle/WSBundle.php

<?php

namespace WSBundle;

use Symfony\Component\HttpKernel\Bundle\Bundle;

class WSBundle extends Bundle
{
}

src/WSBundle/Resources/config/routes.yml

tiposdivisionmenor:
  path:     /ws/tiposDivisionMenor/{id}
  defaults: { _controller: WSBundle:TiposDivisionMenor:index }

But im getting this message:

Unable to find file "@WSBundle/Resources/config/routing.yml" in @WSBundle/Resources/config/routing.yml (which is being imported from "....../app/config/routing.yml"). Make sure the "WSBundle" bundle is correctly registered and loaded in the application kernel class. If the bundle is registered, make sure the bundle path "@WSBundle/Resources/config/routing.yml" is not empty.

Any ideas?

1

1 Answers

2
votes

You're doing right, you have just missed that you have required @WSBundle/Resources/config/routing.yml instead of @WSBundle/Resources/config/routes.yml.