src/View/Helper/FormHelper.php
public function submit($caption = null, array $options = []) {

        if ( ! preg_match('/\.(jpg|jpe|jpeg|gif|png|ico)$/', $caption)) {
            $options = $this->parseButtonClass($options);
        }

        if ( ! empty($this->getConfig('layout.classes.submitContainer'))) {
            $this->_setTemplatesInternal([
                'submitContainer' => '<div{{attrs}}>{{content}}</div>',
            ]);

            // Add the attributes for the submitContainer
            $options['templateVars']['attrs'] = $this->templater()->formatAttributes([
                'class' => $this->getConfig('layout.classes.submitContainer'),
            ]);
        }

        $options = $this->cleanArray($options);

        return parent::submit($caption, $options);
    }
public function submit($caption = null, array $options = []) {

        if ( ! preg_match('/\.(jpg|jpe|jpeg|gif|png|ico)$/', $caption)) {
            $options = $this->parseButtonClass($options);
        }

        if ( ! empty($this->getConfig('layout.classes.submitContainer'))) {
            $this->_setTemplatesInternal([
                'submitContainer' => '<div{{attrs}}>{{content}}</div>',
            ]);

            // Add the attributes for the submitContainer
            $options['templateVars']['attrs'] = $this->templater()->formatAttributes([
                'class' => $this->getConfig('layout.classes.submitContainer'),
            ]);
        }

        $options = $this->cleanArray($options);

        return parent::submit($caption, $options);
    }
public function submit ( $ caption = null , array $ options = [ ] ) { if ( ! preg_match ( '/\.(jpg|jpe|jpeg|gif|png|ico)$/' , $ caption ) ) { $ options = $ this -> parseButtonClass ( $ options ) ; } if ( ! empty ( $ this -> getConfig ( 'layout.classes.submitContainer' ) ) ) { $ this -> _setTemplatesInternal ( [ 'submitContainer' => '<div{{attrs}}>{{content}}</div>' , ] ) ; // Add the attributes for the submitContainer $ options [ 'templateVars' ] [ 'attrs' ] = $ this -> templater ( ) -> formatAttributes ( [ 'class' => $ this -> getConfig ( 'layout.classes.submitContainer' ) , ] ) ; } $ options = $ this -> cleanArray ( $ options ) ; return parent :: submit ( $ caption , $ options ) ; }
Creates submit button but adds bootstrap styling

@param string|null $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
Creates submit button but adds bootstrap styling