form::button PHP Method

button() public static method

public static button ( $value = null, $attributes = [] )
    public static function button($value = null, $attributes = array())
    {
        if (!isset($attributes['type'])) {
            $attributes['type'] = 'button';
        }
        return Html::element('button', Html::entities($value), $attributes);
    }

Usage Example

Example #1
0
 /**
  * Creates an HTML form button input tag.
  *
  * @param   string|array  input name or an array of HTML attributes
  * @param   string|array  input value, when using a name or values
  * @param   string        a string to be attached to the end of the attributes
  * @param   string        $label
  * @param   string|array  $error
  * @param   string|array  $tip
  * @return  string
  */
 public static function button_wrap($data = '', $value = '', $extra = '', $label = '', $error = '', $tip = '')
 {
     $name = is_array($data) ? arr::get($data, 'name') : $data;
     $value = is_array($value) ? arr::get($value, $name) : $value;
     $input = form::button($data, $value, $extra);
     return form::wrap($input, $name, $label, $error, $tip);
 }
All Usage Examples Of form::button