0
votes

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

1
Please let us help you: post your code as text not as Image. It's easier for us. Use the {} button to format it properlygoto
Looks like you are not using the builtin webserver, can you try localhost/app_dev.php/aqua_note/web/genus (notice the app_dev.php)goto
@goto, thanks I got it! My problem was {use Symfony\Component\BrowserKit\Response;] and I had to use [use Symfony\Component\HttpFoundation\Response;]Stelt
Please see if the error is logged somewhere, either in the application’s var/logs/*.log or in the servers logs (e.g. if you’re using PHP-FPM something like /var/log/php*-fpm.log). If you find the error message and can reproduce it by reloading the page, please add it to your question.lxg

1 Answers

0
votes

use:

use Symfony\Component\HttpFoundation\Response;

instead of

use Symfony\Component\BrowserKit\Response;