예제 #1
0
 /**
  * UIButton constructor.
  * Initialise a new HTML Input object
  *
  * @param string $text     The text to display on the button, i.e. 'Click Here'
  * @param string $on_click Javascript function to be run when the object is clicked
  * @param string $type     The type of button, i.e. button, submit, reset
  * @param string $value    The value that the input should start with on page load
  * @param string $name     The name of the input element- needed for submitting a form
  * @param bool   $disabled True if this input should not be editable by the user
  * @param array  $classes  Classes for use with CSS and Javascript
  * @param string $id       HTML ID Attribute
  */
 public function __construct($text = '', $on_click = '', $name = '', $type = 'button', $disabled = false, $classes = ['btn', 'btn-sm', 'btn-primary'], $id = '', $value = '')
 {
     parent::__construct($type, $value, $name, $disabled, $classes, $id);
     $this->setOnClick($on_click);
     $this->text = $text;
 }
예제 #2
0
 /**
  * UIInput constructor.
  * Initialise a new HTML Input object
  *
  * @param string $type      The type of input, i.e. text
  * @param string $value     The value that the input should start with on page load
  * @param string $name      The name of the input element- needed for submitting a form
  * @param string $on_change Javascript function to be run when the input is changed
  * @param bool   $disabled  True if this input should not be editable by the user
  * @param array  $classes   Classes for use with CSS and Javascript
  * @param string $id        HTML ID Attribute
  */
 public function __construct($type = '', $value = '', $name = '', $on_change = '', $disabled = false, $classes = [], $id = '')
 {
     parent::__construct($type, $value, $name, $disabled, $classes, $id);
     $this->on_change = $on_change;
 }