end() 공개 메소드

Overrides parent method to reset the form alignment and grid size.
public end ( array $secureAttributes = [] ) : string
$secureAttributes array Secure attributes which will be passed as HTML attributes into the hidden input elements generated for the Security Component.
리턴 string A closing FORM tag.
예제 #1
0
 public function testErroredTextInput()
 {
     $this->article['errors'] = ['title' => ['error message'], 'published' => ['error']];
     $this->Form->create($this->article);
     $result = $this->Form->input('title');
     $expected = ['div' => ['class' => 'form-group text required has-error'], 'label' => ['class' => 'control-label', 'for' => 'title'], 'Title', '/label', 'input' => ['type' => 'text', 'name' => 'title', 'id' => 'title', 'class' => 'form-control ', 'required' => 'required'], ['div' => ['class' => 'help-block']], 'error message', '/div', '/div'];
     $this->Form->end();
     $this->Form->create($this->article, ['align' => 'horizontal']);
     $result = $this->Form->input('title');
     $expected = ['div' => ['class' => 'form-group text required has-error'], 'label' => ['class' => 'control-label col-md-2', 'for' => 'title'], 'Title', '/label', ['div' => ['class' => 'col-md-6']], 'input' => ['type' => 'text', 'name' => 'title', 'id' => 'title', 'class' => 'form-control', 'required' => 'required'], ['div' => ['class' => 'help-block']], 'error message', '/div', '/div', '/div'];
     $this->assertHtml($expected, $result);
     $result = $this->Form->input('published');
     $expected = ['div' => ['class' => 'form-group checkbox has-error'], ['div' => ['class' => 'col-md-offset-2 col-md-6']], ['div' => ['class' => 'checkbox']], 'input' => ['type' => 'hidden', 'name' => 'published', 'value' => 0], 'label' => ['for' => 'published'], ['input' => ['type' => 'checkbox', 'name' => 'published', 'id' => 'published', 'value' => 1]], 'Published', '/label', '/div', ['div' => ['class' => 'help-block']], 'error', '/div', '/div', '/div'];
     $this->assertHtml($expected, $result);
 }