Re: HTML_IT doesn't parse
| From: | Martin Marques | Date: | Wed, 04 Jun 2003 11:33:07 +0000 |
| Subject: | Re: HTML_IT doesn't parse | ||
| References: | 1 2 3 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-5779@lists.php.net to get a copy of this message | ||
On Mar 03 Jun 2003 12:21, Alexander Merz wrote:
>
> Are you sure, that you wrote <!-- BEGIN hallo --> and
> <!-- END hallo -->? (note the white spaces!)
Nop.
> Could you show as the template and the code somewhere? (please do not
> attach them on a mail to the mailinglist)
Small example (I could show the source, since I'm planing on letting it be
part of PEAR or at least be GPL).
inicio.html
<html>
<!-- BEGIN out -->
<!-- BEGIN empty -->
Something to say<br>
<!-- END empty -->
<!-- BEGIN nonempty -->
{SOME}<br>
<!-- END nonempty -->
<!-- END out -->
</html>
test-IT.php
<?php
require_once "HTML/IT.php";
$tpl = new IntegratedTemplate(".");
$tpl->loadTemplatefile("inicio.html", true, true);
for($i=1;$i<3;$i++){
$tpl->touchBlock("empty");
$tpl->parse("empty");
$tpl->parse("out");
}
for($j=1;$j<3;$j++){
$tpl->setCurrentBlock("nonempty");
$tpl->setVariable("SOME","Another thing to say");
$tpl->parseCurrentBlock();
$tpl->parse("out");
}
$tpl->show();
?>
Output on the browser:
Something to say
Something to say
Something to say
Something to say
Something to say
Another thing to say
Something to say
Another thing to say
Something to say
Now the behavior I think should have this code is:
Something to say
Something to say
Another thing to say
Another thing to say
Any thoughts now???
--
Porqué usar una base de datos relacional cualquiera,
si podés usar PostgreSQL?
-----------------------------------------------------------------
Martín Marqués | mmarques@unl.edu.ar
Programador, Administrador, DBA | Centro de Telematica
Universidad Nacional
del Litoral
-----------------------------------------------------------------