BootstrapUI\View\Helper\FormHelper::submit PHP Метод

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

Overrides parent method to add CSS class btn, to the element.
public submit ( string $caption = null, array $options = [] ) : string
$caption string 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
    public function submit($caption = null, array $options = [])
    {
        $options = $this->applyButtonClasses($options);
        return parent::submit($caption, $options);
    }

Usage Example

Пример #1
0
 public function testStyledFormSubmit()
 {
     $result = $this->Form->submit('Submit', ['class' => 'btn btn-block']);
     $expected = ['div' => ['class' => 'submit'], 'input' => ['type' => 'submit', 'value' => 'Submit', 'class' => 'btn btn-block btn-default']];
     $this->assertHtml($expected, $result);
     $result = $this->Form->submit('Submit', ['class' => ['btn', 'btn-block']]);
     $expected = ['div' => ['class' => 'submit'], 'input' => ['type' => 'submit', 'value' => 'Submit', 'class' => 'btn btn-block btn-default']];
     $this->assertHtml($expected, $result);
 }