Re: template engine...why???
| From: | Robert Cummings | Date: | Wed, 30 Apr 2003 18:27:35 +0000 |
| Subject: | Re: template engine...why??? | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145837@lists.php.net to get a copy of this message | ||
As nasty as I find it, PHP can do it via the following:
<table>
<script language="php">
for( $i = 0; $i < $someArbitraryMax; $i++ )
{
</script>
<tr><td><script language="php"> echo $i;
</script></td></tr>
<script language="php">
}
</script>
</table>
Cheers,
Rob.
Seairth Jacobs wrote:
>
> I see all sorts of problems with this approach, the least of which is that
> you are using your own language constructs. You are no longer using native
> PHP. Rasmus, however, claims that it can all be done with PHP itself (if I
> understand his statements correctly). So, how can the example table be done
> entirely within PHP while keeping to the two constrains below?
>
> ---
> Seairth Jacobs
> seairth@seairth.com
>
> "Luis" <luis@fuegolabs.com> wrote in message
> news:014001c30f3d$ca8a7880$2b00a8c0@fuegolabs.com...
> >
> >
> > <table>
> > {section loop=$foo name=i}
> > <tr><td>{$foo[i]}</td></tr>
> > {/section}
> > </table>
> >
> >
> >
> > From: Seairth Jacobs [mailto:seairth@seairth.com]
> >
> > Can you tell me how you handle something like generating an arbitrary
> > number
> > of <tr>s in a table while:
> >
> > 1) Not using a runtime templating approach, and
> > 2) Still allowing the <table> and <tr> presentations to be altered (say,
> > switching to use of <divs>) without giving access to the underlying
> > logic.
> >
> >
> > "Rasmus Lerdorf" <rasmus@lerdorf.com> wrote in message
> > news:Pine.WNT.4.53.0304300801440.728@DELL...
> > >
> > > The only templating systems I can honestly say are complementary are
> > the
> > > ones that pre-generate pages so there is absolutely no run-time hit
> > from
> > > the templating system. Anything that parses template files and by
> > > whatever means does search and replace stuff at runtime is just
> > inherently
> > > nasty if you care about performance at all.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
--
.---------------------------------------------.
| Worlds of Carnage - http://www.wocmud.org |
:---------------------------------------------:
| Come visit a world of myth and legend where |
| fantastical creatures come to life and the |
| stuff of nightmares grasp for your soul. |
`---------------------------------------------'