Create a submit button

@param   string|array  either fieldname or full attributes array (when array other params are ignored)
@param   string
@param   array
@return  string
775325
public function submit($field = 'submit', $value = 'Submit', array $attributes = array())
	{
		if (is_array($field))
		{
			$attributes = $field;
		}
		else
		{
			$attributes['name'] = (string) $field;
			$attributes['value'] = (string) $value;
		}
		$attributes['type'] = 'submit';

		return $this->input($attributes);
	}
668798
public static function open($form_attr=array()) 
        {
            //this try block is excecuted to enable throwing and catching of errors as appropriate
            try {
                
                     //this block throwing exception if method argument is not an array
                    if(! is_array($form_attr)){
                        throw new HelperException(sprintf('Expecting array of form attributes.e.g.$form_attr = array(\'name\'=>\'form1\',\'action\'=>\'post\')',$form_attr));
                    }
                    $form_attr_str='';
                    foreach($form_attr as $key=>$val){
                        $form_attr_str .= $key.'="'.$val.'" ';
                    }
                    //$form_attr_str = implode('= ',$form_attr);
                    return "<form ".$form_attr_str.' >';
            }

            catch(BaseException $e) {

                //echo $e->getMessage();
                $e->show();

            }

            catch(Exception $e) {

              echo $e->getMessage();

            }

        }
1099310
function createAction() {
    if( !isset( $this->action['value'] ))
      return;
    $attributes = $this->_createParams( $this->action['params'] );
    return $this->_createElement( 'ACTION', $attributes, $this->action['value'] );
  }
686988
public function postButton($title, $url, array $options = array()) {
        $out = $this->create(false, array('id' => false, 'url' => $url));
        if (isset($options['data']) && is_array($options['data'])) {
            foreach (Hash::flatten($options['data']) as $key => $value) {
                $out .= $this->hidden($key, array('value' => $value, 'id' => false));
            }
            unset($options['data']);
        }

        if(isset($options['unlockFields'])){
            $unlockFields = is_array($options['unlockFields']) ? $options['unlockFields'] : array($options['unlockFields']);
            foreach($unlockFields as $unlockField){
                $this->unlockField($unlockField);
            }
        }
        unset($options['unlockFields']);

        $out .= $this->button($title, $options);
        $out .= $this->end();
        return $out;
    }
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).'" />';
    }
410267
public function button($field, $value = null, array $attributes = array())
	{
		if (is_array($field))
		{
			$attributes = $field;
			$value = isset($attributes['value']) ? $attributes['value'] : $value;
		}
		else
		{
			$attributes['name'] = (string) $field;
			$value = isset($value) ? $value :  $attributes['name'];
		}

		return html_tag('button', $this->attr_to_string($attributes), $value);
	}
1234531
public function form_submit($params) {
        if (!isset($params['field'])) {
            throw new \UnexpectedValueException("The field parameter is required.");
        }
        $value = isset($params['value']) ? $params['value'] : null;
        $attributes = isset($params['attrs']) ? $params['attrs'] : array();
        return Form::submit($params['field'], $value, $attributes);
    }
504372
static function radioButton($name, $selectValue, $value, $attr = array())
    {
        if ($selectValue == $value)
            $attr["checked"] = "true";

        $attr = array_merge(
            array(
                "type" => "radio",
            ),
            $attr
        );

        self::input($name, $value, $attr);
    }
241923
def submit_button(*args, **kwargs):
    '''
    
    '''
    submit_button = wtforms.SubmitField(*args, **kwargs)
    submit_button.input_type = 'submit_button'
    return submit_button
208322
public function submitForm(array &$form, FormStateInterface $form_state) {
    $operations = [
      [
        [
          '\Drupal\openy_campaign\Controller\MembersController',
          'deleteAllMembersProcessBatch',
        ],
        [],
      ],
    ];
    $batch = [
      'title' => t('Deleting members'),
      'operations' => $operations,
      'finished' => [
        '\Drupal\openy_campaign\Controller\MembersController',
        'deleteAllMembersFinishBatch',
      ],
    ];
    batch_set($batch);
  }
97445
public function addNew($childName, $parentName, $parentKeyFields)
    {
        // if there is no parent set yet, cant show a button that wont work.
        foreach ($parentKeyFields as $key => $val) {
            if (!trim($val)) {
                return '';
            }
        }

        $elements = array(
            'parent_name' => $parentName,
            'child_name'  => $childName,
        );

        $submitButton = array(
            'name' => 'submit',
            'type' => 'Zend\Form\Element\Submit',
            'attributes' => array(
                'value' => ' + ' . $this->labels[$childName],
            ),
        );

        $form = new \SpeckCatalog\Form\AddChild;
        $form->addElements($elements)
            ->addParent($parentKeyFields);
        $form->add($submitButton);

        $view = $this->getView();
        return $view->render($this->partialDir . 'add', array('addForm' => $form));
    }
714766
function exportValue(&$submitValues, $assoc = false)
    {
        $value = null;
        foreach (array_keys($this->_elements) as $key) {
            $elementName = $this->_elements[$key]->getName();
            if ($this->_appendName) {
                if (is_null($elementName)) {
                    $this->_elements[$key]->setName($this->getName());
                } elseif ('' === $elementName) {
                    $this->_elements[$key]->setName($this->getName() . '[' . $key . ']');
                } else {
                    $this->_elements[$key]->setName($this->getName() . '[' . $elementName . ']');
                }
            }
            $v = $this->_elements[$key]->exportValue($submitValues, $assoc);
            if ($this->_appendName) {
                $this->_elements[$key]->setName($elementName);
            }
            if (null !== $v) {
                // Make $value an array, we will use it like one
                if (null === $value) {
                    $value = array();
                }
                if ($assoc) {
                    // just like HTML_QuickForm::exportValues()
                    $value = HTML_QuickForm::arrayMerge($value, $v);
                } else {
                    // just like getValue(), but should work OK every time here
                    if (is_null($elementName)) {
                        $value = $v;
                    } elseif ('' === $elementName) {
                        $value[] = $v;
                    } else {
                        $value[$elementName] = $v;
                    }
                }
            }
        }
        // do not pass the value through _prepareValue, we took care of this already
        return $value;
    }
104302
function create_field( $field )
	{
		// value must be array
		if( !is_array($field['value']) )
		{
			// perhaps this is a default value with new lines in it?
			if( strpos($field['value'], "\n") !== false )
			{
				// found multiple lines, explode it
				$field['value'] = explode("\n", $field['value']);
			}
			else
			{
				$field['value'] = array( $field['value'] );
			}
		}
		
		
		// trim value
		$field['value'] = array_map('trim', $field['value']);
		
		
		// vars
		$i = 0;
		$e = '<input type="hidden" name="' .  esc_attr($field['name']) . '" value="" />';
		$e .= '<ul class="acf-checkbox-list ' . esc_attr($field['class']) . ' ' . esc_attr($field['layout']) . '">';
		
		
		// checkbox saves an array
		$field['name'] .= '[]';
		
		
		// foreach choices
		foreach( $field['choices'] as $key => $value )
		{
			// vars
			$i++;
			$atts = '';
			
			
			if( in_array($key, $field['value']) )
			{
				$atts = 'checked="yes"';
			}
			if( isset($field['disabled']) && in_array($key, $field['disabled']) )
			{
				$atts .= ' disabled="true"';
			}
			
			
			// each checkbox ID is generated with the $key, however, the first checkbox must not use $key so that it matches the field's label for attribute
			$id = $field['id'];
			
			if( $i > 1 )
			{
				$id .= '-' . $key;
			}
			
			$e .= '<li><label><input id="' . esc_attr($id) . '" type="checkbox" class="' . esc_attr($field['class']) . '" name="' . esc_attr($field['name']) . '" value="' . esc_attr($key) . '" ' . $atts . ' />' . $value . '</label></li>';
		}
		
		$e .= '</ul>';
		
		
		// return
		echo $e;
	}
1128674
public function open($attributes = array(), array $hidden = array())
	{
		$attributes = ! is_array($attributes) ? array('action' => $attributes) : $attributes;

		// If there is still no action set, Form-post
		if( ! array_key_exists('action', $attributes) or empty($attributes['action']))
		{
			$attributes['action'] = \Uri::main();
		}

		// If not a full URL, create one
		elseif ( ! strpos($attributes['action'], '://'))
		{
			$attributes['action'] = \Uri::create($attributes['action']);
		}

		if (empty($attributes['accept-charset']))
		{
			$attributes['accept-charset'] = strtolower(\Fuel::$encoding);
		}

		// If method is empty, use POST
		! empty($attributes['method']) || $attributes['method'] = $this->get_config('form_method', 'post');

		$form = '<form';
		foreach ($attributes as $prop => $value)
		{
			$form .= ' '.$prop.'="'.$value.'"';
		}
		$form .= '>';

		// Add hidden fields when given
		foreach ($hidden as $field => $value)
		{
			$form .= PHP_EOL.$this->hidden($field, $value);
		}

		return $form;
	}
956464
public function submitButton(string $label = '')
    {
        $markup = '<p class="-submit submit">';
        $markup .= '<button class="button button-primary" type="submit">';
        $markup .= $label ?: __('Save Changes', 'wp-sharks-core');
        $markup .= '</button>';
        $markup .= '</p>';

        return $markup;
    }
490210
public static function customButton($title, $url, $attributes = array())
    {
        // configuration
        $config = self::config();

        // no configuration file
        if (!$config) {
            return null;
        }

        $attributes = Helpers::addClass($attributes, "clef");

        return '<a href="https://clef.io/iframes/qr?app_id='.$config['app_id'].'&amp;redirect_url='.$url.'" '.\HTML::attributes($attributes).'>'.$title.'</a>';
    }
123516
public function formButtons(array $options = []): string
    {
        $url = ['action' => 'index'];
        $options = Hash::merge([
            'useReferer' => false,
            'horizontalLine' => true,
            'cancelButton' => true,
            'saveButtonTitle' => __d('ck_tools', 'save'),
            'cancelButtonTitle' => __d('ck_tools', 'cancel'),
        ], $options);

        if (!empty($options['useReferer']) && $this->request->referer() !== '/') {
            $url = $this->request->referer();
        }

        $formButtons = '<div class="submit-group">';
        if ($options['horizontalLine']) {
            $formButtons .= '<hr>';
        }
        $formButtons .= $this->Form->button($options['saveButtonTitle'], ['class' => 'btn-success']);
        if ($options['cancelButton']) {
            $formButtons .= $this->backButton($options['cancelButtonTitle'], $url, ['class' => 'btn btn-default cancel-button', 'icon' => null]);
        }
        $formButtons .= '</div>';

        return $formButtons;
    }