/** * Renders given DOM element as subtemplate. * * @param \DOMElement $domElement DOM element to subrender. * @param Scope $scope Subtemplate Scope object. * @return string Rendered HTML. */ protected function subcompile(\DOMElement $domElement, $scope) { $template = new Template($this->phCompile); /** * Remove ng-repeat attribute so we won't fall into infinite loop while parsing. */ $domElement->removeAttribute('ng-repeat'); /** * Tag element with render class, for easy client-side JavaScript manipulation. */ Utils::addClass($domElement, $this->phCompile->getConfig('compile.class')); $template->setHTML($domElement->ownerDocument->saveHTML($domElement)); $template->setScope($scope); return $template->compile(); }
/** * @covers PhCompile\Template\Template::getHTML * @depends testSetHTML */ public function testGetHTML() { $html = file_get_contents(TEST_PATH . 'template/overall.html'); $this->template->setHTML($html); $this->assertSame($html, $this->template->getHTML()); }