AdamWathan\Form\Elements\FormOpen::render PHP Method

render() public method

public render ( )
    public function render()
    {
        $tags = [sprintf('<form%s>', $this->renderAttributes())];
        if ($this->hasToken() && $this->attributes['method'] !== 'GET') {
            $tags[] = $this->token->render();
        }
        if ($this->hasHiddenMethod()) {
            $tags[] = $this->hiddenMethod->render();
        }
        return implode($tags);
    }

Usage Example

コード例 #1
0
ファイル: FormOpenTest.php プロジェクト: adamwathan/form
 public function testRenderBasicFormOpen()
 {
     $form = new FormOpen();
     $expected = '<form method="POST" action="">';
     $result = $form->render();
     $this->assertEquals($expected, $result);
 }