modResource.getCacheKey
Последнее обновление not available | История страницы | Улучшить эту страницу | Сообщить о проблеме
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn moremodResource::getCacheKey¶
Подставляет [contextKey] и [id] в шаблон _cacheKey, который конструктор задаёт как [contextKey]/resources/[id].
При пустом $context берётся контекст запроса (_contextKey) с запасным вариантом в поле context_key. Если в шаблоне нет [, он возвращается без изменений.
Синтаксис¶
string getCacheKey ([string $context = ''])
-
$context(string) ключ контекста, для которого строить ключ, по умолчанию''
Пример¶
$resource = $modx->getObject('modResource', array('id' => 5));
$key = $resource->getCacheKey('web');
Смотрите также¶
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$194 per month—let's make that $500!
Learn more










