Re: HTMP Template Proposal
| From: | Joachim dot werner at diggin-data dot de | Date: | Thu, 22 Mar 2007 11:05:10 +0000 |
| Subject: | Re: HTMP Template Proposal | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-45964@lists.php.net to get a copy of this message | ||
Sorry, the link is wrong.
Please use
http://www.diggin-data.de/wiki/static/PhpPearHTML_Template_DD.html
Best Regards,
Joachim Werner
> Hello,
>
> I was looking for a PHP replacement for the php_template extension.
> The extension is able to parse a nested array in one go.
>
> I have written a PEAR class to do this.
>
> Usage example:
>
> Template file 'page.tpl.htm':
>
> <h1>{title}</h1>
> <table>
> <tmpl:contacts>
> <tr>
> <td>{name}</td>
> <td>{firstname}</td>
> </tr></tmpl:contacts>
> </table>
>
>
> // Set up data array for the page
> $data = array(
> 'title' => 'Contacts List',
> 'contacts' => array(
> array('name' => 'Doe', 'firstname' => 'John',
> array('name' => 'Smith', 'firstname' =>
> 'Jane'
> )
> );
> // Create an instance of HTML_Template_DD
> $oTpl = new HTML_Template_DD( );
> // Set the template file
> $res = $oTpl->getTplFile( 'page.tpl.htm' );
> // Parse the template
> $oTpl->parse( $data );
> $oTpl->show();
>
> The class has ca. 280 lines of code.
>
> I wonder if this is worth proposing as a PEAR class?
>
> More infos and download here:
>
>
> https://www.diggin-data.de/wiki/wiki/run.php?iRequest=wiki/ViewPage&iPage=PhpPearHTML_Template_DD
>
> Thanks in advance,
>
> --
> Joachim Werner
> Wiesbaden, Germany
>
> --
> PEAR Development Mailing List (http://pear.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>