I start the tutorial (as newbie) and everythings works fine till:
http://symfony.com/doc/current/book/page_creation.html#creating-a-page-route-and-controller at step
You actually don't extend Symfony Controller class. It should be class LuckyController extends Controller
// src/AppBundle/Controller/LuckyController.php
namespace AppBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Response;
class LuckyController extends Controller {
/**
* @Route("/lucky/number")
*/
public function numberAction() {
$number = rand(0, 100);
return new Response('Lucky number: '.$number.'');
}
}
EDIT: after all, the problem in this question was not in extending controller, so ignore my answer.