Created
November 25, 2020 15:35
-
-
Save iboved/91babac092e987815d0ebe5599f448d5 to your computer and use it in GitHub Desktop.
Cache partial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function onRender() | |
{ | |
$content = \Cache::rememberForever('menu-data-'.$this->alias, function() { | |
return $this->renderPartial('::default.htm', ['menuItems' => $this->menuItems()]); | |
}); | |
return $content; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment