renderRest example

->getForm()
            ->createView();

        // Render field2 row -> does not implicitly call renderWidget because         // it is a repeated field!         $this->renderRow($view['field2']);

        // Render field3 widget         $this->renderWidget($view['field3']);

        // Rest should only contain field1 and field4         $html = $this->renderRest($view);

        $this->assertMatchesXpath($html,
            '/tr [ ./td [./label[@for="name_field1"]] /following-sibling::td [./input[@id="name_field1"]] ] /following-sibling::tr [ ./td [./label[@for="name_field4"]] /following-sibling::td [./input[@id="name_field4"]] ] [count(../tr)=3] [count(..//label)=2] [count(..//input)=3] /following-sibling::tr[@style="display: none"] [./td[@colspan="2"]/input [@type="hidden"] [@id="name__token"] ] '
->getForm()
            ->createView();

        // Render field2 row -> does not implicitly call renderWidget because         // it is a repeated field!         $this->renderRow($view['field2']);

        // Render field3 widget         $this->renderWidget($view['field3']);

        // Rest should only contain field1 and field4         $html = $this->renderRest($view);

        $this->assertMatchesXpath($html,
            '/div [ ./label[@for="name_field1"] /following-sibling::input[@type="text"][@id="name_field1"] ] /following-sibling::div [ ./label[@for="name_field4"] /following-sibling::input[@type="text"][@id="name_field4"] ] [count(../div)=2] [count(..//label)=2] [count(..//input)=3] /following-sibling::input [@type="hidden"] [@id="name__token"] '
Home | Imprint | This part of the site doesn't use cookies.