It does not find the Route prescribed using annotations, although debug: router shows that there is such a path. Here is how it is registered in the controller:

namespace Iphpsandbox\PhotoBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Iphpsandbox\PhotoBundle\Entity\Photo; use Symfony\Component\HttpFoundation\Request; class PhotoController extends Controller { /** * @Route ("/photos", name = "photos") */ 

Here is the routing.yml:

 iphpsandbox_photo: resource: '@IphpsandboxPhotoBundle/Controller/PhotoController.php' type: annotation 

Connected the same way as AppBundle, but for some reason symfony issues

No route found for "GET / photos /"

  • one
    GET /photos/ and GET /photos - different routes (slash on the end) - Dmitriy Simushev
  • Thanks, I entered / photos like this, but the router itself delivered a slash, due to the fact that there is another router defined as GET / photos / g {id} - Denis Stepanyuk

1 answer 1

 namespace Iphpsandbox\PhotoBundle\Controller; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Iphpsandbox\PhotoBundle\Entity\Photo; use Symfony\Component\HttpFoundation\Request; class PhotoController extends Controller { /** * @Route("/photos{trailingSlash}", requirements={"trailingSlash" = "[/]{0,1}"}, defaults={"trailingSlash" = "/"}) */