1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
<?php
/**
* This demo shows how cache Texy! output and
* demonstrates advantages of inheriting from base Texy object
*/
require_once dirname(__FILE__).'/mytexy.php';
$texy = new MyTexy();
// processing
$text = file_get_contents('sample.texy');
$html = $texy->process($text);
// echo formated output
header('Content-type: text/html; charset=utf-8');
echo '<title>' . $texy->headingModule->title . '</title>';
// echo $texy->time
echo '<strong>' . number_format($texy->time, 3, ',', ' ') . 'sec</strong>';
echo '<br />';
// echo formated output
echo $html;
// echo HTML code
echo '<hr />';
echo '<pre>';
echo htmlspecialchars($html);
echo '</pre>';
|