submit() public method

Create a submit button element.
public submit ( string $value = null, array $options = [] ) : Illuminate\Support\HtmlString
$value string
$options array
return Illuminate\Support\HtmlString
 /**
  * Create a Boostrap submit button.
  *
  * @param  string $value
  * @param  array  $options
  *
  * @return string
  */
 public function submit($value = null, array $options = [])
 {
     $options = array_merge(['class' => 'btn btn-primary'], $options);
     $inputElement = $this->form->submit($value, $options);
     $wrapperOptions = $this->isHorizontal() ? ['class' => implode(' ', [$this->getLeftColumnOffsetClass(), $this->getRightColumnClass()])] : [];
     $wrapperElement = '<div' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . '</div>';
     return $this->getFormGroup(null, $wrapperElement);
 }
Exemplo n.º 2
0
 /**
  * Create a Boostrap submit button.
  *
  * @param  string  $value
  * @param  array   $options
  * @return string
  */
 public function submit($value = null, array $options = [])
 {
     $options = array_merge(['class' => 'btn btn-primary'], $options);
     $wrapperOptions = [];
     if ($this->getType() === Type::HORIZONTAL) {
         $wrapperOptions = ['class' => $this->getLeftColumnOffsetClass() . ' ' . $this->getRightColumnClass()];
     }
     $inputElement = $this->form->submit($value, $options);
     $groupElement = '<div ' . $this->html->attributes($wrapperOptions) . '>' . $inputElement . '</div>';
     return $this->getFormGroup(null, $groupElement);
 }
Exemplo n.º 3
0
 /**
  * Create a submit button element.
  *
  * @param string $value
  * @param array $options
  * @return string 
  * @static 
  */
 public static function submit($value = null, $options = array())
 {
     return \Collective\Html\FormBuilder::submit($value, $options);
 }
Exemplo n.º 4
0
 public function destroy2($text, $message, $class = null)
 {
     return parent::submit($text, ['class' => 'btn btn-danger ' . ($class ? $class : ''), 'onclick' => 'return confirm(\'' . $message . '\')']);
 }
Exemplo n.º 5
0
 public function submit($value = null, $options = [])
 {
     $options['class'] = 'btn btn-cons btn-awesome' . (isset($options['class']) ? ' ' . $options['class'] : '');
     return parent::submit($value, $options);
 }
Exemplo n.º 6
0
 public function submit($value = null, $options = [])
 {
     $cancelUrl = array_key_exists('cancelUrl', $options) ? $options['cancelUrl'] : null;
     $cancelHtml = '';
     $options = $this->setOptionClasses('', $options, ['btn', 'btn-primary']);
     $controlOptions = $this->getControlOptions(collect($options));
     $controlHtml = parent::submit($value, $controlOptions->toArray());
     if (!is_null($cancelUrl)) {
         $cancelHtml = link_to($cancelUrl, 'Cancel', ['class' => 'btn btn-cancel pull-right']);
     }
     // TODO: render cancel and reset buttons.
     return $this->renderControl('submit', $controlHtml, '', '', $options);
 }
 private function registerFormSubmit()
 {
     FormBuilder::macro('button_submit', function ($texte) {
         return FormBuilder::submit($texte, ['class' => 'btn btn-info pull-right']);
     });
 }
Exemplo n.º 8
0
 /**
  * {@inheritdoc}
  * @param string|null $value   The value of the submit button
  * @param array       $options The options
  * @return string
  */
 public function submit($value = null, $options = array())
 {
     $options['class'] = isset($options['class']) ? 'btn ' . Button::NORMAL . ' ' . $options['class'] : 'btn ' . Button::NORMAL;
     return parent::submit($value, $options);
 }