Prado\Web\UI\WebControls\TXmlTransform::setDocumentPath PHP Method

setDocumentPath() public method

public setDocumentPath ( $value )
    public function setDocumentPath($value)
    {
        if (!is_file($value)) {
            $value = Prado::getPathOfNamespace($value, self::EXT_XML_FILE);
            if ($value === null) {
                throw new TInvalidDataValueException('xmltransform_documentpath_invalid', $value);
            }
        }
        $this->setViewState('DocumentPath', $value, '');
    }

Usage Example

Esempio n. 1
0
 public function testRenderWithDocumentPathAndTransformPath()
 {
     $expected = "<b>Hello World!</b>\n";
     $transform = new TXmlTransform();
     $transform->setDocumentPath($this->documentPath);
     $transform->setTransformPath($this->transformPath);
     $textWriter = new TTextWriter();
     $htmlWriter = new THtmlWriter($textWriter);
     $transform->render($htmlWriter);
     $actual = $textWriter->flush();
     self::assertEquals($expected, $actual);
 }