-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Allow for caching of widgets #421
Conversation
src/Widget/CacheTrait.php
Outdated
$this->key = $this->createKey(); | ||
} | ||
|
||
public function cachedInvoke(): string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can't this method just overwrite __invoke() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to try something else to make it more elegant.
Overriding it would be nice, but won't work in this case. A trait can override methods from the base (extended) class, but then there's no such thing as a ::parent
.
Makes a big difference, especially for widgets like 'news'...
Before:
After: