*/
public $templateName = '';
+ /**
+ * enables template usage
+ * @var string
+ */
+ public $useTemplate = true;
+
/**
* value of the given action parameter
* @var string
// call show event
EventHandler::getInstance()->fireAction($this, 'show');
- // show template
- if (!empty($this->templateName)) {
+ if ($this->useTemplate) {
+ // try to guess template name
+ if (empty($this->templateName)) {
+ $classParts = explode('\\', get_class($this));
+ $className = preg_replace('~(Form|Page)$~', '', array_pop($classParts));
+ $this->templateName = lcfirst($className);
+ }
+
+ // show template
WCF::getTPL()->display($this->templateName);
}
}