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

Add a method for widget template to static cache the template and prevent multiple calls #62

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

eluhr
Copy link
Contributor

@eluhr eluhr commented Feb 19, 2024

Currently this request is made for every Cell Widget on the page. With this static cache it is only called once per page.

->orderBy('name')
->all();
foreach ($templates as $template) {
foreach (self::widgetTemplateItems() as $templateId => $templateName) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method widgetTemplateItems() is not static and should therefore be called here via $this->widgetTemplateItems(), or am I missing something?

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

Successfully merging this pull request may close these issues.

3 participants