ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilSubmitButton.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2012 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once "Services/UIComponent/Button/classes/class.ilButtonBase.php";
5
14{
15 protected $cmd; // [string]
16
17 public static function getInstance()
18 {
19 return new self(self::TYPE_SUBMIT);
20 }
21
22
23 //
24 // properties
25 //
26
32 public function setCommand($a_value)
33 {
34 $this->cmd = trim($a_value);
35 }
36
42 public function getCommand()
43 {
44 return $this->cmd;
45 }
46
47
48 //
49 // render
50 //
51
52 public function render()
53 {
54 $this->prepareRender();
55
56 $attr = array();
57 $attr["type"] = "submit";
58 $attr["name"] = "cmd[" . $this->getCommand() . "]";
59 $attr["value"] = $this->getCaption();
60
61 return '<input' . $this->renderAttributes($attr) . ' />';
62 }
63}
An exception for terminatinating execution or to throw for unit testing.
renderAttributes(array $a_additional_attr=null)
Render current HTML attributes.
prepareRender()
Prepare render.
getCaption($a_translate=true)
Get caption.
static getInstance()
Factory.
setCommand($a_value)
Set submit command.
render()
Render HTML.
getCommand()
Get submit command.