Jump to main content Jump to doc navigation

Событие: OnBeforeSaveWebPageCache

Запускается после того как ресурс загружен но еще не закэшировался. Если ресурс не кэшируемый, то это событие не сработает.

Служба: 4 - Cache Service Events Группа: Нет

Параметры события

Нет. На ресурс можно ссылаться через $modx->resource.

Пример

Такой плагин запишет в "Журнал ошибок" id загруженного ресурса:

<?php
$eventName = $modx->event->name;
switch($eventName) {
    case 'OnBeforeSaveWebPageCache':
        $res = $modx->resource->get('id');
        $modx->log(modX::LOG_LEVEL_ERROR, 'Ресурс с id '.$res.' успешно загрузился');
        break;
}

Смотри также

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

$0 per month—let's make that $500!

Learn more