cvs: peardoc /en/package/html/html-template-flexy/html-template-flexy getelements.xml
| From: | Alan Knowles | Date: | Sat, 02 Aug 2003 12:02:55 +0000 |
| Subject: | cvs: peardoc /en/package/html/html-template-flexy/html-template-flexy getelements.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-1170@lists.php.net to get a copy of this message | ||
alan_k Sat Aug 2 08:02:55 2003 EDT
Added files:
/peardoc/en/package/html/html-template-flexy/html-template-flexy
getelements.xml
Log:
adding getelement docs - finally getting back into sync with reality.. part2
Index: peardoc/en/package/html/html-template-flexy/html-template-flexy/getelements.xml
+++ peardoc/en/package/html/html-template-flexy/html-template-flexy/getelements.xml
<!-- $Revision: 1.1 $ -->
<refentry id="package.html.html-template-flexy.html-template-flexy.getelements">
<refnamediv>
<refname>->getElements()</refname>
<refpurpose>Fetch Dynamic HTML Elements from template </refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>void
<function>->getElements</function></funcdef>
<paramdef></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1
id="package.html.html-template-flexy.html-template-flexy.getelements.desc">
&title.desc;
<para>
All Form elements, FORM, INPUT, SELECT and any HTML tag that includes the attribute
flexy:dynamic
Is converted into HTML_Template_Flexy_Element's and stored serialized in the same folder
as the
Compiled flexy template.
</para>
<para>
You can use this array to make changes to these elements or find out what form elements
exist on a page.
</para>
<para>
Note: you should put the modified result as the $elements argument of >outputObject(),
you do not however
have to fetch the elements to assign them, you can just create blank elements, and merge
them.
</para>
</refsect1>
<refsect1
id="package.html.html-template-flexy.html-template-flexy.getelements.return">
&title.returns;
<para>
<parameter>array</parameter> - of Elements contained within the template. (or an
empty array if
no form/dynamic elements are used)
</para>
</refsect1>
<refsect1
id="package.html.html-template-flexy.html-template-flexy.getelements.note">
&title.note;
¬e.notstatic;
</refsect1>
<refsect1
id="package.html.html-template-flexy.html-template-flexy.getelements.example">
&title.example;
<example>
<title>Introspecting a template</title>
<programlisting role="php">
<![CDATA[
$form = new HTML_Template_Flexy();
$form->compile($this->masterTemplate);
print_r($form->getElements());
]]>
</programlisting>
</example>
<example>
<title>template example</title>
<programlisting role="html">
<![CDATA[
<BODY>
<FORM name="XXXX">
<INPUT name="yyy">
<SELECT name="zzz">
<OPTION value="aaaa">AAAAA</OPTION>
</SELECT>
</FORM>
</BODY>
]]>
</programlisting>
</example>
<example>
<title>template compiled</title>
<programlisting role="html">
<![CDATA[
<BODY>
<?php echo $this->elements['XXXX']->toHtmlnoClose();?>
<?php echo $this->elements['yyy']->toHtml();?>
<?php echo $this->elements['zzz']->toHtml();?>
</form>
</BODY>
]]>
</programlisting>
</example>
<example>
<title>output from the Introspection</title>
<programlisting>
<![CDATA[
Array
(
[XXXX] => html_template_flexy_element Object
(
[tag] => form
[attributes] => Array
(
[name] => XXXX
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
)
[yyy] => html_template_flexy_element Object
(
[tag] => input
[attributes] => Array
(
[name] => yyy
)
[children] => Array
(
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
)
[zzz] => html_template_flexy_element Object
(
[tag] => select
[attributes] => Array
(
[name] => zzz
)
[children] => Array
(
[0] =>
[1] => html_template_flexy_element Object
(
[tag] => option
[attributes] => Array
(
[value] => aaaa
)
[children] => Array
(
[0] => AAAAA
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
)
[2] =>
)
[override] =>
[prefix] =>
[suffix] =>
[value] =>
)
)
]]>
</programlisting>
</example>
</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
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
-->