Hello,the phpers.i'm recently learn to use the pear HTML_Template_IT,
The following is my test template test.tpl,the source code is :
<!-- BEGIN CELL -->
<!-- END CELL -->

And my php revoke source code is :
        require_once "HTML/Template/IT.php";

        $data = array("Peter","Quagmire","Joe");

        $tpl = new HTML_Template_IT("./template");

        if (!$tpl) {
                echo "object inital failed!";
                echo "<br />";
                print "Object initial succeed!<br />";

        $tpl->loadTemplatefile("test.tpl", true, true)  ;

        if (!$tpl) {
                echo "template load failed!";
                echo "<br />";
                print "template load succeed!<br />";

        foreach ($data as $sd  ){
                //echo $sd;
                //echo "<br />";
                $tpl->setVariable("DATA", $sd);

When it runs it just result this :

Object initial succeed!
template load succeed!

i don't why the array data are not displayed?Any comments are appreciated !

All you best
What we are struggling for ?
The life or the life ?

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to