PM-Riabel PM-Riabel - 11 months ago 77
PHP Question

Symfony Routing: No route found for "GET /user/add"

I am developing a simple User App to practice Symfony (3.1.3).
I created a new Bundle,



namespace PIE10Bundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;

class BackendUmController extends Controller
* @Route("/user")
public function indexAction()
// nothing for now

* @Route("/user/add")
public function adduserAction()
return $this->render('PIE10Bundle:users:layout_new_user.html.twig');

and created a test view on,


When I try to access that using the following URL,


it gives the following 404 Error

No route found for "GET /user/add"

and I tried some on-line solutions like clear cache... but could not solve this and I need someones hand to get rid this error.

And please let me know if any other information needed related to my development.

Answer Source

Did you have add in app/config/routing.yml

    resource: "@PIE10Bundle/Controller/"
    type:     annotation

You have to check this (name="foo").

 * @Route("/", name="homepage")
public function adduserAction(Request $request)
    // replace this example code with whatever you need