From 5ac3fc4203dd5e95ba59f0f70b1cb394734bd578 Mon Sep 17 00:00:00 2001 From: demeritcowboy Date: Mon, 7 Mar 2022 09:25:30 -0500 Subject: [PATCH] do same thing as CRM_Core_Form --- CRM/Core/Page.php | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/CRM/Core/Page.php b/CRM/Core/Page.php index 7f9e785610f9..76a3e7e26e25 100644 --- a/CRM/Core/Page.php +++ b/CRM/Core/Page.php @@ -519,4 +519,25 @@ public static function crmIcon($icon, $text = NULL, $condition = TRUE, $attribs return "$sr"; } + /** + * Add an expected smarty variable to the array. + * + * @param string $elementName + */ + public function addExpectedSmartyVariable(string $elementName): void { + $this->expectedSmartyVariables[] = $elementName; + } + + /** + * Add an expected smarty variable to the array. + * + * @param array $elementNames + */ + public function addExpectedSmartyVariables(array $elementNames): void { + foreach ($elementNames as $elementName) { + // Duplicates don't actually matter.... + $this->addExpectedSmartyVariable($elementName); + } + } + }