Created
October 10, 2024 05:53
-
-
Save 4e6ka/c59a39dfa2e4dd586e3b218d1dfedc98 to your computer and use it in GitHub Desktop.
Сниппет для кеширования чанка, для старого парсера modx revo
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
snippet cache_chunk | |
<?php | |
$cache_key = "chunk_".$name; | |
$output = $modx->cacheManager->get($cache_key); | |
if (empty($output)) { | |
$output = $modx->getChunk($name, $scriptProperties); | |
$modx->cacheManager->set($cache_key,$output); | |
} | |
return $output; | |
?> | |
Пример вызова: | |
[[cache_chunk? &name=`header`]] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment