/**
* This virtual function is used to set the default values of various form elements.
*
- * @return array|NULL
+ * @return array
* reference to the array of default values
*/
public function setDefaultValues() {
- return NULL;
+ return [];
}
/**
// our ensured variables get blown away, so we need to set them even if
// it's already been initialized.
self::$_template->ensureVariablesAreAssigned($this->expectedSmartyVariables);
-
+ self::$_template->addExpectedTabHeaderKeys();
}
/**
$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);
+ }
+ }
+
/**
* Render form and return contents.
*
* Adds a select based on field metadata.
* TODO: This could be even more generic and widget type (select in this case) could also be read from metadata
* Perhaps a method like $form->bind($name) which would look up all metadata for named field
- * @param $name
+ * @param string $name
* Field name to go on the form.
* @param array $props
* Mix of html attributes and special properties, namely.