video
EOT; $markup[] = << file EOT; $markup[] = << image Image image Lorem Ipsum with image Lorem Ipsum with image EOT; $markup[] = <<Curabitur feugiat. Proin pharetra odio a erat. Etiam sed tortor. Nunc scelerisque augue ac ligula congue dignissim. Suspendisse mattis, nisl vitae iaculis imperdiet, ante mi rutrum arcu,  eu rhoncus nisi dui et orci. Quisque interdum sollicitudin mi.

EOT; class TestMarkupvfsfile { /** * utility class * @var JSTestUtil */ protected $util; /** * Scanner * @var WBMarkup_Scanner */ protected $scan; /** * Handler * @var WBMarkup_Handler_Xml2Html */ protected $hdl; public function __construct() { $this->ute = new JSTestUtil(); $this->scan = WBClass::create( 'WBMarkup_Scanner' ); $this->hdl = WBClass::create( 'WBMarkup_Handler_Xml2Html' ); //$this->hdl = WBClass::create( 'WBMarkup_Handler_Xml2Xinha' ); $this->scan->setHandler($this->hdl); } public function setTmplDir($dir) { $this->hdl->setTmplDir($dir); } public function displayAll($markup) { $this->ute->mkHeader(true); foreach ($markup as $ml) { $this->doDisplay($ml); } $this->ute->mkFooter(true); } public function displayOne($markup) { $this->ute->mkHeader(true); $this->doDisplay($markup); $this->ute->mkFooter(true); } private function doDisplay($ml) { echo "
\n"; echo "

Convert ".strlen($ml)." bytes

\n"; //echo "
XML\n"; //echo htmlspecialchars( $ml ); echo "
HTML\n"; echo "scan " . $this->scan->scan($ml) . "
\n"; $html = WBString::replaceSuperPlaceholders($this->hdl->getParsedContent()); echo $html . "
\n"; echo nl2br(htmlspecialchars( $html)) . "
\n"; } } $test = new TestMarkupVfsfile(); $test->setTmplDir('foo'); $test->displayAll($markup); ?>