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

Move ViewableData::Me() out of ViewableData and into the template layer #11261

Open
GuySartorelli opened this issue May 23, 2024 · 0 comments
Open

Comments

@GuySartorelli
Copy link
Member

GuySartorelli commented May 23, 2024

The ViewableData::Me() method just returns $this. It only exists as a way for the template layer to refer to the current item in scope. This should be moved into the template layer.

I originally did this as part of #11244 but I had to remove it (see https://github.com/silverstripe/silverstripe-framework/compare/f9e757a0a201799dbb1d2535c90e2cb309982026..29793a31415d01c4173cb560e7d97f399d270971) because it was causing some failures in the kitchen sink.

Acceptance criteria

  • PHP logic that relies on calling the Me() method is refactored to not rely on that method.
  • The ViewableData::Me() method is removed
  • Using $Me in a template behaves identically to how it currently does
    • In control blocks, it references the current item
    • On its own, it tries to render the item to the template
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant