AdamWathan\Form\Elements\FormOpen::render PHP Méthode

render() public méthode

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

Exemple #1
0
 public function testRenderBasicFormOpen()
 {
     $form = new FormOpen();
     $expected = '<form method="POST" action="">';
     $result = $form->render();
     $this->assertEquals($expected, $result);
 }