NEW: Add onBeforeRender extension hook to Form

This commit is contained in:
Loz Calver 2022-11-02 10:02:42 +00:00
parent e454db6dc9
commit c925fae180
1 changed files with 5 additions and 2 deletions

View File

@ -1552,10 +1552,13 @@ class Form extends ViewableData implements HasRequestHandler
HTTPCacheControlMiddleware::singleton()->disableCache();
}
$return = $this->renderWith($this->getTemplates());
$context = $this;
$this->extend('onBeforeRender', $context);
$return = $context->renderWith($this->getTemplates());
// Now that we're rendered, clear message
$this->clearMessage();
$context->clearMessage();
return $return;
}