@@ -288,7 +288,7 @@ methods:
288
288
{
289
289
// ...
290
290
291
- + #[ORM\Column(type: " text")];
291
+ + #[ORM\Column(type: ' text')]
292
292
+ private $description;
293
293
294
294
// getDescription() & setDescription() were also added
@@ -361,7 +361,7 @@ and save it::
361
361
362
362
class ProductController extends AbstractController
363
363
{
364
- #[Route('/product', name: 'create_product')
364
+ #[Route('/product', name: 'create_product')]
365
365
public function createProduct(ManagerRegistry $doctrine): Response
366
366
{
367
367
$entityManager = $doctrine->getManager();
@@ -446,7 +446,7 @@ some basic validation tasks::
446
446
447
447
class ProductController extends AbstractController
448
448
{
449
- #[Route('/product', name: 'create_product')
449
+ #[Route('/product', name: 'create_product')]
450
450
public function createProduct(ValidatorInterface $validator): Response
451
451
{
452
452
$product = new Product();
@@ -505,6 +505,7 @@ be able to go to ``/product/1`` to see your new product::
505
505
506
506
use App\Entity\Product;
507
507
use Symfony\Component\HttpFoundation\Response;
508
+ use Symfony\Component\Routing\Annotation\Route;
508
509
// ...
509
510
510
511
class ProductController extends AbstractController
@@ -537,6 +538,7 @@ and injected by the dependency injection container::
537
538
use App\Entity\Product;
538
539
use App\Repository\ProductRepository;
539
540
use Symfony\Component\HttpFoundation\Response;
541
+ use Symfony\Component\Routing\Annotation\Route;
540
542
// ...
541
543
542
544
class ProductController extends AbstractController
@@ -619,6 +621,7 @@ Now, simplify your controller::
619
621
use App\Entity\Product;
620
622
use App\Repository\ProductRepository;
621
623
use Symfony\Component\HttpFoundation\Response;
624
+ use Symfony\Component\Routing\Annotation\Route;
622
625
// ...
623
626
624
627
class ProductController extends AbstractController
@@ -648,6 +651,7 @@ with any PHP model::
648
651
use App\Entity\Product;
649
652
use App\Repository\ProductRepository;
650
653
use Symfony\Component\HttpFoundation\Response;
654
+ use Symfony\Component\Routing\Annotation\Route;
651
655
// ...
652
656
653
657
class ProductController extends AbstractController
0 commit comments