简体   繁体   中英

Symfony routing 500 error

It is the first time will use symfony. The setup went ok but now I have a problem with de routing... I have a controller called "GenusController" and use "Sensio\\Bundle\\FrameworkExtraBundle\\Configuration\\Route;".

My controller:

namespace AppBundle\Controller;

use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\BrowserKit\Response;

class GenusController
{
    /**
     * @Route("/genus")
     */
    public function showAction(){
        return new Response("Text");
    }

}

When I tried to go to visite the url ( http://localhost/aqua_note/web/genus ) I get an 500 Internal Server Error. Is there some one can help me with this problem?

I am following this tutorial https://knpuniversity.com/screencast/symfony3/first-page#play

use:

use Symfony\Component\HttpFoundation\Response;

instead of

use Symfony\Component\BrowserKit\Response;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM