LoginSignup
0
0

Symfony6でのルーティングの方法

Posted at

従来のやり方

/**
*@Route('/hello', name='hello')
*/
public function helloControler() {
    return $this->render('/hello/hello.html.twig',[
        message => 'Hello!'
    ]);
}

Symfony6でのやり方

-/**
-*@Route('/hello', name='hello')
-*/
+#[Route('/hello', name:'hello')]
public function helloControler() {
    return $this->render('/hello/hello.html.twig',[
        message => 'Hello!'
    ]);
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0