/** * Render this form. * * @return string rendered form * @api * @throws \Neos\Form\Exception\RenderingException */ public function render() { if ($this->isAfterLastPage()) { $this->invokeFinishers(); return $this->response->getContent(); } $this->formState->setLastDisplayedPageIndex($this->currentPage->getIndex()); if ($this->formDefinition->getRendererClassName() === null) { throw new \Neos\Form\Exception\RenderingException(sprintf('The form definition "%s" does not have a rendererClassName set.', $this->formDefinition->getIdentifier()), 1326095912); } $rendererClassName = $this->formDefinition->getRendererClassName(); $renderer = new $rendererClassName(); if (!$renderer instanceof \Neos\Form\Core\Renderer\RendererInterface) { throw new \Neos\Form\Exception\RenderingException(sprintf('The renderer "%s" des not implement RendererInterface', $rendererClassName), 1326096024); } $controllerContext = $this->getControllerContext(); $renderer->setControllerContext($controllerContext); $renderer->setFormRuntime($this); return $renderer->renderRenderable($this); }
/** * @test */ public function contentCanBeSetAppendedAndRetrieved() { $response = new Response(); $response->setContent('Two households, both alike in dignity, '); $response->appendContent('In fair Verona, where we lay our scene'); $this->assertEquals('Two households, both alike in dignity, In fair Verona, where we lay our scene', $response->getContent()); $response->setContent('For never was a story of more woe, Than this of Juliet and her Romeo.'); $this->assertEquals('For never was a story of more woe, Than this of Juliet and her Romeo.', $response->getContent()); $this->assertEquals('For never was a story of more woe, Than this of Juliet and her Romeo.', (string) $response); }
/** * Returns the DOM crawler which can be used to interact with the web page * structure, submit forms, click links or fetch specific parts of the * website's contents. * * The returned DOM crawler is bound to the response of the last executed * request. * * @return \Symfony\Component\DomCrawler\Crawler * @api */ public function getCrawler() { $crawler = new Crawler(null, $this->lastRequest->getBaseUri()); $crawler->addContent($this->lastResponse->getContent(), $this->lastResponse->getHeader('Content-Type')); return $crawler; }