Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mark class as Resource with Attribute #4

Open
mamazu opened this issue Dec 23, 2024 · 0 comments
Open

Mark class as Resource with Attribute #4

mamazu opened this issue Dec 23, 2024 · 0 comments

Comments

@mamazu
Copy link
Contributor

mamazu commented Dec 23, 2024

Currently if you want to mark a class as resource you have to define a static property on the class or a property on the object. It would be easier if there was a unified way with an attribute something like this:

#[Resource(resourceKey: 'event')]
class Event {
}

Alternatively you could also generate the resource key from the class name as it's usually Str::asTwigVariable($className).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant