mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-19 18:38:55 +00:00

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@166396 c90b9560-bf6c-de11-be94-00142212c4b1
100 lines
2.6 KiB
XML
Executable file
100 lines
2.6 KiB
XML
Executable file
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
<!-- $Revision: 1.2 $ -->
|
|
<refentry id="function.tidy-construct">
|
|
<refnamediv>
|
|
<refname>tidy::__construct</refname>
|
|
<refpurpose>
|
|
Constructs a new tidy object
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<methodsynopsis>
|
|
<type>object</type><methodname>tidy::__construct</methodname>
|
|
<methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam>
|
|
<methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam>
|
|
<methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>tidy::__construct</function> constructs a new tidy object.
|
|
</para>
|
|
<para>
|
|
If the <parameter>filename</parameter> parameter is given, this function
|
|
will also read that file and initialize the object with the file,
|
|
acting like <function>tidy_parse_file</function>.
|
|
</para>
|
|
&tidy.conf-enc;
|
|
<para>
|
|
<example>
|
|
<title><function>tidy::__construct</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
$html = <<< HTML
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
<head><title>title</title></head>
|
|
<body>
|
|
<p>paragraph <bt />
|
|
text</p>
|
|
</body></html>
|
|
|
|
HTML;
|
|
|
|
$tidy = new tidy;
|
|
$tidy->parseString($html);
|
|
|
|
$tidy->CleanRepair();
|
|
|
|
if ($tidy->errorBuffer) {
|
|
echo "The following errors were detected:\n";
|
|
echo $tidy->errorBuffer;
|
|
}
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<para>
|
|
The above example will output:
|
|
</para>
|
|
<screen>
|
|
<![CDATA[
|
|
The following errors were detected:
|
|
line 8 column 14 - Error: <bt> is not recognized!
|
|
line 8 column 14 - Warning: discarding unexpected <bt>
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>tidy_parse_file</function> and
|
|
<function>tidy_parse_string</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|