Make a button instance.

@param  string  $action
@param  string  $type
@param  array   $attributes
@param  bool    $disabled

@return self
426035
public static function make($action, $type = 'button', array $attributes = [], $disabled = false)
    {
        return new static($action, $type, $attributes, $disabled);
    }
1218730
public function button($value, $name = null, $attributes = array())
    {
        $name = pick($name, $value);

        return $this->tag('button', $value)
                    ->set(array('id' => $name, 'name' => $name))
                    ->set($attributes);
    }
960447
public function button(
            $label    = null,
            $url      = null,
            $status   = null,
            $icon     = null,
            $block    = false,
            $disabled = false,
            $flat     = false,
            $size     = Button::SIZE_NORMAL)
    {
        $button = new Button($label, $url, $status, $icon, $block, $disabled, $flat, $size);
        return $this->addButton($button);
    }
246931
public function make(UploadedFile $file, array $attributes = [])
    {
        return $this->save($file->getClientOriginalName(), file_get_contents($file), $attributes);
    }
118675
public function button($name, $position="BL", $attributes=array())
    {
        $attributes = array_merge(array("class"=>"btn btn-default"), $attributes);

        $this->button_container[$position][] = Form::button($name, $attributes);

        return $this;
    }
1205232
public static function add($action, $type, $id = null)
    {
        if (!is_null($id))
            self::$modelMap[$type][$id] = $action;
        else
            self::$typeMap[$type] = $action;
    }
192123
public function denied($action, $resourceType)
    {
        $this->assertLockInstanceIsSet();

        return $this->lock->denied($action, $resourceType);
    }
877400
public static function button(
        string $label, 
        string $type = "submit", 
        string $onclick = null, 
        array $attributes = []
    ) : string
    {
        $buttonPreAttributes = [
            "type" => $type,
        ];
        
        if ($onclick) {
            $buttonPreAttributes["onclick"] = $onclick;
        }
        $buttonAttributes = array_merge($buttonPreAttributes, $attributes);        
        
        return self::tag("button", $label, $buttonAttributes);
    }
1046500
public static function create($template = null, $action = null, $method = 'POST', $encType = null) {

		return new static($template, $action, $method, $encType);

	}
327005
protected function submit(UploadedFile $file, $type, array $attributes)
    {
        switch ($type) {
            case 'image':
                return (new \Routegroup\Media\Upload\Image)->make($file, $attributes);

            case 'audio':
                return (new \Routegroup\Media\Upload\Audio)->make($file, $attributes);

            case 'video':
                return (new \Routegroup\Media\Upload\Video)->make($file, $attributes);

            case 'archive':
                return (new \Routegroup\Media\Upload\Archive)->make($file, $attributes);

            default:
                return (new \Routegroup\Media\Upload\File)->make($file, $attributes);
        }
    }
159769
protected function _event($action, $data = [])
    {
        $_event = new Event('Controller.PostTypes.' . $this->type['name'] . '.' . $action, $this, $data);
        $this->eventManager()->dispatch($_event);
    }
1133416
public function open($action = "/", $attributes = null)
    {
        return '<form action="'.$action.'"'. (($attributes !== null) ? $this->attributes($attributes) : "") . '>';
    }
355473
public function linkAction($action, $title = null, $parameters = [], $attributes = [])
    {
        return $this->link($this->url->action($action, $parameters), $title, $attributes);
    }
1333011
public static function create($name, $attributes)
    {
        // Not supported is type=image, <button>, list, output, select-optgroup
        $types = [

            // Standard HTML 4.01
            'text'              => '\Anax\HTMLForm\FormElementText',
            'file'              => '\Anax\HTMLForm\FormElementFile',
            'password'          => '\Anax\HTMLForm\FormElementPassword',
            'hidden'            => '\Anax\HTMLForm\FormElementHidden',
            'textarea'          => '\Anax\HTMLForm\FormElementTextarea',
            'radio'             => '\Anax\HTMLForm\FormElementRadio',
            'checkbox'          => '\Anax\HTMLForm\FormElementCheckbox',
            'select'            => '\Anax\HTMLForm\FormElementSelect',
            'select-multiple'   => '\Anax\HTMLForm\FormElementSelectMultiple',
            'submit'            => '\Anax\HTMLForm\FormElementSubmit',
            'reset'             => '\Anax\HTMLForm\FormElementReset',
            'button'            => '\Anax\HTMLForm\FormElementButton',

            // HTML5
            'color'             => '\Anax\HTMLForm\FormElementColor',
            'date'              => '\Anax\HTMLForm\FormElementDate',
            'number'            => '\Anax\HTMLForm\FormElementNumber',
            'range'             => '\Anax\HTMLForm\FormElementRange',
            'tel'               => '\Anax\HTMLForm\FormElementTel',
            'email'             => '\Anax\HTMLForm\FormElementEmail',
            'url'               => '\Anax\HTMLForm\FormElementUrl',
            'search'            => '\Anax\HTMLForm\FormElementSearch',
            'file-multiple'     => '\Anax\HTMLForm\FormElementFileMultiple',
            'datetime'          => '\Anax\HTMLForm\FormElementDatetime',
            'datetime-local'    => '\Anax\HTMLForm\FormElementDatetimeLocal',
            'month'             => '\Anax\HTMLForm\FormElementMonth',
            'time'              => '\Anax\HTMLForm\FormElementTime',
            'week'              => '\Anax\HTMLForm\FormElementWeek',

            // Custom
            'search-widget'     => '\Anax\HTMLForm\FormElementSearchWidget',
            'checkbox-multiple' => '\Anax\HTMLForm\FormElementCheckboxMultiple',
            // Address
        ];

        // $attributes['type'] must contain a valid type creating an object
        // to succeed.
        $type = isset($attributes['type']) ? $attributes['type'] : null;
        if (!($type && isset($types[$type]))) {
            throw new Exception("Form element does not exists and can not be created: $name - $type");
        }
        return new $types[$type]($name, $attributes);
    }
96844
private function addRoute($types = '', $uri, $action = [])
    {

        if (is_string($action)) {
            $action = ['_controller' => $action];
        }

        if (is_array($action)) {
            if (isset($action['as'])) {
                AsCollector::addAs($action['as'], $uri);
            }
        }

        $types = (array)$types;

        foreach ($types as $type) {
            $type = mb_convert_case($type, MB_CASE_UPPER);

            $add = [
                'uri' => isset(static::$firing['when']) ? $this->createWhenUri($uri) : $uri,
                'action' => $action
            ];;

            // add group parameter to action variable
            if (isset(static::$firing['group'])) {
                $add['group'] = static::$firing['group'];
            }

            // add to collection
            static::$routes[$type][] = $add;
        }
        return $this;
    }
135998
public function button($name, $value = null, $attributes = null)
    {
        return '<input type="button" name="'.$name.'" '.(($attributes !== null) ? $this->attributes($attributes) : "").' value="'.$this->getValue($name, $value).'" />';
    }
841952
public static function start($name = null, $method = null, $action = null, $enctype = null, $attribs = [])
    {
        $form = static::create()
            ->name($name)
            ->setAttribute('id', $name)
            ->method($method)
            ->action($action)
            ->enctype($enctype);

        foreach ($attribs as $key => $value) {
            $form->setAttribute($key, $value);
        }

        return $form->renderStart();
    }