Gregwar\Formidable\Form::getHtml PHP 메소드

getHtml() 공개 메소드

Convert to HTML
public getHtml ( )
    public function getHtml()
    {
        $html = '';
        if ($this->parserData->needJs()) {
            $html .= $this->getJs();
        }
        $k = 0;
        foreach ($this->parserData->getData() as $data) {
            if ($data instanceof Fields\FileField) {
                $data->getHtml(true);
            }
            $html .= (string) $data;
        }
        if ($html[strlen($html) - 1] != "\n") {
            $html .= "\n";
        }
        return $html;
    }

Usage Example

예제 #1
0
 /**
  * Testing that Formidable output given back to Formidable gives the same output
  */
 public function testOutIn()
 {
     $form = $this->getForm('out_in.html');
     $html = $form->getHtml();
     $otherForm = new Form($html);
     $otherHtml = $otherForm->getHtml();
     $this->assertEquals($html, $otherHtml);
 }