function pcb_form_system_performance_settings_alter in Permanent Cache Bin 8
Same name and namespace in other branches
- 8.2 pcb.module \pcb_form_system_performance_settings_alter()
Implements hook_form_FORM_ID_alter().
File
- ./
pcb.module, line 29 - Module file for pcb.
Code
function pcb_form_system_performance_settings_alter(array &$form, FormStateInterface $form_state) {
$bins = Cache::getBins();
foreach ($bins as $bin => $object) {
if (method_exists($object, 'deleteAllPermanent')) {
$form['clear_cache'][$bin] = [
'#name' => $bin,
'#type' => 'submit',
'#value' => t('Clear permanent cache for @bin', [
'@bin' => $bin,
]),
'#submit' => [
'pcb_form_system_performance_settings_submit',
],
];
}
}
}