Answer the question
In order to leave comments, you need to log in
Why don't attributes work in Symfony?
Hello. I installed symphony 6.
I make the first controller and the application is not going to .
I tried to transfer the attribute to the method, changed the attribute itself -
HomePageController does not work:
<?php
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
#[Route(path: '/homepage')]
class HomePageController extends AbstractController
{
public function __invoke()
{
$this->json(['success' => true], Response::HTTP_OK);
}
}
controllers:
resource: ../../src/Controller/
type: annotation
kernel:
resource: ../../src/Kernel.php
type: annotation
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 139
!!
!! // Clearing the cache for the dev environment with debug
!! // true
!!
!! Segmentation fault
!!
Script @auto-scripts was called via post-install-cmd
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question