Skip to content

Creating routes with native attributes  #17089

@Dameen-Rainer

Description

@Dameen-Rainer

Description

Are there any plans to use native PHP attributes to define routes next to the methods of the controllers associated to those routes? So we can have the routes & their corresponding methods at the same place inside controllers for the sake of clarity.

class ArticlesController extends AppController
{

 #[Route('/articles', name: 'articles-index')]
 public function index(): Response 
 {
     // Logic goes here 
 }

}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions