cvs: peardoc /peardoc2/en/package/html/html-template-flexy/html-template-flexy bufferedoutputobject.xml outputobject.xml

From: Date: Sun, 02 Feb 2003 10:05:50 +0000
Subject: cvs: peardoc /peardoc2/en/package/html/html-template-flexy/html-template-flexy bufferedoutputobject.xml outputobject.xml
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-352@lists.php.net to get a copy of this message
alan_k Sun Feb 2 05:05:50 2003 EDT Added files: /peardoc/peardoc2/en/package/html/html-template-flexy/html-template-flexy bufferedoutputobject.xml outputobject.xml Log: changed to lower case

Index: peardoc/peardoc2/en/package/html/html-template-flexy/html-template-flexy/bufferedoutputobject.xml +++ peardoc/peardoc2/en/package/html/html-template-flexy/html-template-flexy/bufferedoutputobject.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-template-flexy.html-template-flexy.bufferedoutputobject"> <refnamediv> <refname>-&gt;bufferedOutputObject()</refname> <refpurpose>Merges a controller object with the template and returns the result</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>void <function>-&gt;bufferedOutputObject()</function></funcdef> <paramdef>object <parameter>$controllerObject</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-template-flexy.html-template-flexy.bufferedoutputobject.desc"> &title.desc; <para> This maps the values of the supplied object and runs the compiled template, and returns the result. </para> <para> This can be used in conjuction with PEAR::Cache, or in the example below, with a email template (note this still needs testing.. - the backend should eventually support a native tokenizer for email templates.) </para> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.bufferedoutputobject.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>object $controllerObject</parameter> - The object you want to use with the template, the values of the object will relate to the $controllerObject->tag will map to {tag} on the template </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.bufferedoutputobject.return"> &title.returns; <para> <parameter>string</parameter> - the object variables overlayed on the template </para> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.bufferedoutputobject.note"> &title.note; &note.notstatic; </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.bufferedoutputobject.example.php"> &title.example; <example> <title>Simple output example</title> <programlisting role="php"> <![CDATA[ class DataObjects_Person { var $id; var $name; var $password; var $cleartextPassword; var $email; function send_password() { $this->generatePassword(); $template = new HTML_Template_Flexy(); $template->compile("Emails/Send_Password.txt"); $mailtext = $template->bufferedOutputObject($this); $decoder = new Mail_mimeDecode($mailtext); $parts = $decoder->getSendArray(); if (PEAR::isError($parts)) { echo "PROBLEM: {$parts->message}"; exit; } list($recipents,$headers,$body) = $parts; $mail = Mail::factory("SMTP",$options); $mail->send($recipents,$headers,$body); } } ]]> </programlisting> </example> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.bufferedoutputobject.example.html"> &title.example; <example> <title>Simple template example</title> <programlisting role="html"> <![CDATA[ From: "HTML_Template_Flexy" <html_template_flexy@pear.php.net> Sender: "HTML_Template_Flexy" <html_template_flexy@pear.php.net> To: {email} Subject: Here is your new password Content-Type: text/plain; charset=us-ascii Dear {name} Your New Password is {cleartextPassword} please use it to log into your bank account :) ]]> </programlisting> </example> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.bufferedoutputobject.example.output"> &title.example; <example> <title>Simple ouput example</title> <programlisting role="html"> <![CDATA[ From: "HTML_Template_Flexy" <html_template_flexy@pear.php.net> Sender: "HTML_Template_Flexy" <html_template_flexy@pear.php.net> To: demo@example.com Subject: Here is your new password Content-Type: text/plain; charset=us-ascii Dear Fred Blobs Your New Password is 0ab123dcc please use it to log into your bank account :) ]]> </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 --> Index: peardoc/peardoc2/en/package/html/html-template-flexy/html-template-flexy/outputobject.xml +++ peardoc/peardoc2/en/package/html/html-template-flexy/html-template-flexy/outputobject.xml <!-- $Revision: 1.1 $ --> <refentry id="package.html.html-template-flexy.html-template-flexy.outputobject"> <refnamediv> <refname>-&gt;outputObject()</refname> <refpurpose>Merges a controller object with the template and outputs the result</refpurpose> </refnamediv> <refsynopsisdiv> <funcsynopsis> <funcprototype> <funcdef>void <function>-&gt;outputObject()</function></funcdef> <paramdef>object <parameter>$controllerObject</parameter></paramdef> </funcprototype> </funcsynopsis> </refsynopsisdiv> <refsect1 id="package.html.html-template-flexy.html-template-flexy.outputobject.desc"> &title.desc; <para> This maps the values of the supplied object and runs the compiled template, and outputs the result. </para> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.outputobject.parameter"> &title.param; <para> <itemizedlist> <listitem> <para> <parameter>object $controllerObject</parameter> - The object you want to use with the template, the values of the object will relate to the $controllerObject->tag will map to {tag} on the template </para> </listitem> </itemizedlist> </para> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.outputobject.note"> &title.note; &note.notstatic; </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.outputobject.example.php"> &title.example; <example> <title>Simple output example</title> <programlisting role="php"> <![CDATA[ class example { var $tag = ">> hello world"; } $data = new example; $output = new HTML_Template_Flexy(); $output->compile("hello.html"); $output->outputObject($data); ]]> </programlisting> </example> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.outputobject.example.html"> &title.example; <example> <title>Simple template example</title> <programlisting role="html"> <![CDATA[ <B>{tag}</B> <B>{tag:h}</B> ]]> </programlisting> </example> </refsect1> <refsect1 id="package.html.html-template-flexy.html-template-flexy.outputobject.example.output"> &title.example; <example> <title>Simple ouput example</title> <programlisting role="html"> <![CDATA[ <B>&gt;&gt; hello world</B> <B>>> hello world</B> ]]> </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 -->
« previous php.pear.doc (#352) next »