RE: [PHP Template] Revised proposal

[email protected] ("Paras Dagli") Thu, 17 Feb 2000 16:19:59 -0800
Newsgroups php.template
Message-ID <[email protected]>
Definately templates are standalone from the PHP scripts that process them,
but it would be nice to make them into modules pairs. Here is an example:

<modulePair: GetUpdates>
  php: getupdates.php
  tmpl: getupdates.tmpl
</modulePair>

This way the same php, and tmpl does not need to be coded for everypage.
also for a developer i can change the layout of the GetUpdates module in one
template file and have it show up on all the other templates that call on
this module.

This could be implemented by having a header file that has all the module
pairs defines, similar to a header file in c. You could define module pairs
in that header file, and a developer would just have to include that header
file.

paras



-----Original Message-----
From: Andrei Zmievski [mailto:[email protected]]
Sent: Thursday, February 17, 2000 2:01 PM
To: Dan Libby
Cc: [email protected]
Subject: Re: [PHP Template] Revised proposal


On Wed, 16 Feb 2000, Dan Libby wrote:
> Right.  I guess the problem I see is that when people do an include they
expect
> it to be self-contained.  So in the above example, template b may have
been
> written by someone else 3 months before, and the designer suddenly says,
aha --
> I could use that here.  So there has to be understanding by everone
involved
> that include has a different meaning here than in other systems and that
such a
> template would have  to be thoroughly checked to make sure it doesn't use
any
> unknown variables.

Yes, since templates are not standalone and have to be processed by PHP
scripts, you can't simply separate a piece of template and reuse it
later without reusing some PHP code as well.

Handling unnknowns is planned via .ini or some other setting. It will
either silently remove unknowns, loudly complain about them, or turn
them into HTML comments.

> This may just be a process issue, or maybe it won't come up as often as I
fear.

I don't think it's a big problem.

> I'd prefer defaulting to doc_root.  Then we could have tpl_set_root allow
an
> override for someone
> that really wants to use something elsewhere in the filesystem (depending
on php
> settings).

That's fine. Stuff like this can be tuned up later.

-Andrei
* Software never has bugs. It just develops random features. *