php-doc-en/reference/tidy/functions/tidy-getopt.xml
2004-07-03 15:47:18 +00:00

94 lines
2.5 KiB
XML

<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.2 $ -->
<refentry id="function.tidy-getopt">
<refnamediv>
<refname>tidy_getopt</refname>
<refpurpose>
Returns the value of the specified configuration option for the tidy document.
</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<para>Procedural style:</para>
<methodsynopsis>
<type>mixed</type><methodname>tidy_getopt</methodname>
<methodparam><type>resource</type><parameter>tidy</parameter></methodparam>
<methodparam><type>string</type><parameter>option</parameter></methodparam>
</methodsynopsis>
<para>Object oriented style:</para>
<methodsynopsis>
<type>mixed</type><methodname>tidy->getOpt</methodname>
<methodparam><type>string</type><parameter>option</parameter></methodparam>
</methodsynopsis>
<para>
<function>tidy_getopt</function> returns the value of the specified
<parameter>option</parameter> for the specified
<parameter>tidy</parameter> document. The return type depends on the type
of the specified <parameter>option</parameter>. You will find a list with
each configuration option and their types at: <ulink
url="&url.tidy.conf;">&url.tidy.conf;</ulink>.
</para>
<para>
<example>
<title><function>tidy_getopt</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
$html ='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html><head><title>Title</title></head>
<body>
<p><img src="img.png"></p>
</body></html>';
$config = array('accessibility-check' => 3,
'alt-text' => 'some text');
$tidy = new tidy();
$tidy->parseString($html, $config);
var_dump($tidy->getOpt('accessibility-check')); //integer
var_dump($tidy->getOpt('lower-literals')); //boolean
var_dump($tidy->getOpt('alt-text')); //string
?>
]]>
</programlisting>
<para>
The above example will output:
</para>
<screen>
<![CDATA[
int(3)
bool(true)
string(9) "some text"
]]>
</screen>
</example>
</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
-->