Skip to content

Commit 0da8244

Browse files
committed
bug #81 Fix extends on ControllerWithTwig template (welcoMattic)
This PR was merged into the 1.0-dev branch. Discussion ---------- Fix extends on ControllerWithTwig template `Symfony\Bundle\FrameworkBundle\Controller\AbstractController` doesn't implement `getParameter` method. I replaced it by `Symfony\Bundle\FrameworkBundle\Controller\Controller` # How to test - `bin/console make:controller HomeController` - Open `/home` Commits ------- 26df2bd Fix extends on ControllerWithTwig template
2 parents 6137fe1 + 26df2bd commit 0da8244

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Resources/skeleton/controller/Controller.tpl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
namespace App\Controller;
44

55
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6-
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
77
use Symfony\Component\HttpFoundation\Response;
88

9-
class <?= $controller_class_name ?> extends AbstractController
9+
class <?= $controller_class_name ?> extends Controller
1010
{
1111
/**
1212
* @Route("<?= $route_path ?>", name="<?= $route_name ?>")
1313
*/
14-
public function index()
14+
public function index(): Response
1515
{
1616
return new Response('Welcome to your new controller!');
1717
}

src/Resources/skeleton/controller/ControllerWithTwig.tpl.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,15 @@
33
namespace App\Controller;
44

55
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
6-
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6+
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
77
use Symfony\Component\HttpFoundation\Response;
88

9-
class <?= $controller_class_name ?> extends AbstractController
9+
class <?= $controller_class_name ?> extends Controller
1010
{
1111
/**
1212
* @Route("<?= $route_path ?>", name="<?= $route_name ?>")
1313
*/
14-
public function index()
14+
public function index(): Response
1515
{
1616
// replace this line with your own code!
1717
return $this->render('@Maker/demoPage.html.twig', [ 'path' => str_replace($this->getParameter('kernel.project_dir').'/', '', __FILE__) ]);

0 commit comments

Comments
 (0)