cvs: presentations /slides/extending-tidy ext3.xml
| From: | jim winstead | Date: | Wed, 22 Oct 2003 21:52:53 +0000 |
| Subject: | cvs: presentations /slides/extending-tidy ext3.xml | ||
| Groups: | php.pres | ||
| Request: | Send a blank email to pres+get-863@lists.php.net to get a copy of this message | ||
jimw Wed Oct 22 17:52:53 2003 EDT
Modified files:
/presentations/slides/extending-tidy ext3.xml
Log:
more complete example
Index: presentations/slides/extending-tidy/ext3.xml
diff -u presentations/slides/extending-tidy/ext3.xml:1.1
presentations/slides/extending-tidy/ext3.xml:1.2
--- presentations/slides/extending-tidy/ext3.xml:1.1 Fri Apr 25 08:23:37 2003
+++ presentations/slides/extending-tidy/ext3.xml Wed Oct 22 17:52:53 2003
@@ -4,12 +4,30 @@
A good way to do this is to write a sample PHP script that illustrates
how your extension is going to be accessed from a PHP script.
</blurb>
-<example title="HTML Tidy Sample Extension"
type="php"><![CDATA[<?php
+<example title="HTML Tidy Sample Extension" type="php" result="1"
required_extension="tidy" ><![CDATA[<?php
$tidy = tidy_create();
tidy_set_option($tidy, "show-body-only", "yes");
-tidy_parse_string("<b>foo <i>bar</i></b>");
+tidy_parse_string($tidy, "<b>foo <i>bar</b></i>");
tidy_clean_and_repair($tidy);
+ob_start();
tidy_output($tidy);
+$clean = ob_get_contents();
+ob_end_clean();
+echo htmlspecialchars($clean);
+?>]]></example>
+<example title="HTML Tidy Sample Extension (OO for PHP4)"
type="php"><![CDATA[<?php
+$tidy = new tidy();
+$tidy->set_option("show-body-only", "yes");
+$tidy->parse_string("<b>foo <i>bar</b></i>");
+$tidy->clean_and_repair();
+$tidy->output();
+?>]]></example>
+<example title="HTML Tidy Sample Extension (OO for PHP5)"
type="php"><![CDATA[<?php
+$tidy = new tidy();
+$tidy->show_body_only = "yes";
+$tidy->parse_string("<b>foo <i>bar</b></i>");
+$tidy->clean_and_repair();
+$tidy->output();
?>]]></example>
</slide>