Error ClassNotFoundException in Symfony 3 Router

0

Someone can explain me the following error in Symfony 3.0:

I have created a bundle called blog, for which I defined the path /blog :

blog_homepage:
    path:     /blog
    defaults: { _controller: BlogBundle:Default:index }

When I start working with the entities, I get the following error:

  

ClassNotFoundException in appDevUrlGenerator.php line 14: Attempted to   load class "UrlGenerator" from namespace   "BlogBundle \ Entity \ Symfony \ Component \ Routing \ Generator". Did you   forget to "use" statement for   "Symfony \ Component \ Routing \ Generator \ UrlGenerator"?

After so much testing and testing, the error is corrected if I change the route for another (it should be noted that there is no other route called / blog), for example something like this:

blog_homepage:
    path:     /blogp
    defaults: { _controller: BlogBundle:Default:index }

It is something very absurd, someone can tell me why, and how to correct it.

    
asked by Gustavo Panchi 17.04.2017 в 16:43
source

1 answer

0

Verify that you have not downloaded any bundle that has that route implemented.

Sometimes the bundles for example EasyAdminBundle , they bring default routes that they use to access their different functionalities.

    
answered by 23.06.2017 / 19:10
source