* @inheritDoc
*/
public function getHtml() {
- return WCF::getTPL()->fetch('__form', 'wcf', [
+ return WCF::getTPL()->fetch('__form', 'wcf', array_merge($this->getHtmlVariables(), [
'form' => $this
- ]);
+ ]));
}
/**
public function getDocument();
/**
- * Returns the HTML representation of this node.
+ * Returns the html representation of this node.
*
- * @return string HTML representation of node
+ * @return string html representation of node
*/
public function getHtml();
+ /**
+ * Returns additional template variables used to generate the html representation
+ * of this node.
+ *
+ * @return array additional template variables
+ */
+ public function getHtmlVariables();
+
/**
* Returns the id of the form node.
*
*/
abstract public function getDocument();
+ /**
+ * Returns additional template variables used to generate the html representation
+ * of this node.
+ *
+ * @return array additional template variables
+ */
+ public function getHtmlVariables() {
+ return [];
+ }
+
/**
* Returns the id of the form node.
*
* @inheritDoc
*/
public function getHtml() {
- return WCF::getTPL()->fetch($this->templateName, 'wcf', [
+ return WCF::getTPL()->fetch($this->templateName, 'wcf', array_merge($this->getHtmlVariables(), [
'container' => $this
- ], true);
+ ]), true);
}
/**
return WCF::getTPL()->fetch(
$this->templateName,
'wcf',
- ['field' => $this],
+ array_merge($this->getHtmlVariables(), ['field' => $this]),
true
);
}