submit() публичный Метод

### Options - type - Set to 'reset' for reset inputs. Defaults to 'submit' - templateVars - Additional template variables for the input element and its container. - Other attributes will be assigned to the input element.
public submit ( string | null $caption = null, array $options = [] ) : string
$caption string | null The label appearing on the button OR if string contains :// or the extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension exists, AND the first character is /, image is relative to webroot, OR if the first character is not /, image is relative to webroot/img.
$options array Array of options. See above.
Результат string A HTML submit button
 /**
  *
  * Create & return a Twitter Like submit input.
  *
  * New options:
  * 	- bootstrap-type: Twitter bootstrap button type (primary, danger, info, etc.)
  * 	- bootstrap-size: Twitter bootstrap button size (mini, small, large)
  *
  * Unusable options: div
  *
  **/
 public function submit($caption = null, array $options = array())
 {
     return parent::submit($caption, $this->_createButtonOptions($options));
 }
Пример #2
0
 /**
  * Creates a submit button element.
  *
  * Overrides parent method to add CSS class `btn`, to the element.
  *
  * @param string $caption The label appearing on the button OR if string contains :// or the
  *  extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension
  *  exists, AND the first character is /, image is relative to webroot,
  *  OR if the first character is not /, image is relative to webroot/img.
  * @param array $options Array of options. See above.
  * @return string A HTML submit button
  * @link http://book.cakephp.org/3.0/en/views/helpers/form.html#creating-buttons-and-submit-elements
  */
 public function submit($caption = null, array $options = [])
 {
     $options = $this->applyButtonClasses($options);
     return parent::submit($caption, $options);
 }
 public function submit($caption = null, array $options = [])
 {
     return parent::submit($caption, $this->_injectStyles($options, 'btn btn-success'));
 }
Пример #4
0
 public function submit($caption = null, array $options = [])
 {
     $options = $this->addClass($options, 'btn btn-default');
     return parent::submit($caption, $options);
 }
Пример #5
0
 /**
  * Creates a submit button element.
  *
  * Overrides parent method to add CSS class `btn`, to the element.
  *
  * @param string $caption The label appearing on the button OR if string contains :// or the
  *  extension .jpg, .jpe, .jpeg, .gif, .png use an image if the extension
  *  exists, AND the first character is /, image is relative to webroot,
  *  OR if the first character is not /, image is relative to webroot/img.
  * @param array $options Array of options. See above.
  * @return string A HTML submit button
  * @link http://book.cakephp.org/3.0/en/views/helpers/form.html#creating-buttons-and-submit-elements
  */
 public function submit($caption = null, array $options = [])
 {
     $class = ['btn'];
     if (array_key_exists('class', $options)) {
         $optionsClass = is_array($options['class']) ? $options['class'] : explode(' ', $options['class']);
         $class = array_unique(array_merge($class, $optionsClass));
     }
     $options = Hash::merge($options, ['class' => $class]);
     return parent::submit($caption, $options);
 }
 /**
  * 
  * Create & return a Twitter Like submit input.
  * 
  * New options:
  * 	- bootstrap-type: Twitter bootstrap button type (primary, danger, info, etc.)
  * 	- bootstrap-size: Twitter bootstrap button size (mini, small, large)
  * 
  * Unusable options: div
  * 
  **/
 public function submit($caption = null, array $options = array())
 {
     $options = $this->_addButtonClasses($options);
     return parent::submit($caption, $options);
 }