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
예제 #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);
 }