Skip to content
Snippets Groups Projects
Commit b965a044 authored by Andreas Gohr's avatar Andreas Gohr
Browse files

added convenience method to display item as button

parent 50ca245c
No related branches found
No related tags found
No related merge requests found
......@@ -166,6 +166,26 @@ abstract class AbstractItem {
return $html;
}
/**
* Convenience method to create a <button> element inside it's own form element
*
* Uses html_btn()
*
* @todo this does currently not support the SVG icon
* @return string
*/
public function asHtmlButton() {
return html_btn(
$this->getType(),
$this->id,
$this->getAccesskey(),
$this->getParams(),
$this->method,
$this->getTitle(),
$this->getLabel()
);
}
/**
* Should this item be shown in the given context
*
......
......@@ -21,4 +21,16 @@ class Top extends AbstractItem {
$this->context = self::CTX_DESKTOP;
}
/**
* Convenience method to create a <button> element
*
* Uses html_topbtn()
*
* @todo this does currently not support the SVG icon
* @return string
*/
public function asHtmlButton() {
return html_topbtn();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment