Re: Handling unparsed placeholders

[email protected] (Andrei Zmievski)
Newsgroups php.template
Message-ID <[email protected]>
On Tue, 15 Feb 2000, Tobias Ratschiller wrote:
> Hey!

Hi, Tobias.

> One thing I missed in your draft is the handling of placeholders, which
> aren't assigned a value to. The PHPLib Template class allows you to specify
> a $unknowns variable in the class' constructor, which defines how to handle
> placeholders which aren't used in your script. This is a nice feature for
> debugging and error handling.

What does $unknowns variable do? What is stored in it?

> Also, I don't understand the configuration variables part of your draft. Are
> these configuration directive specific to the template module, or do you
> mean PHP configuration?

No, basically, configuration files for the application. For example, we
have an application that does user feedback on news articles and we have
a configuration file, which looks like this:

## globals ##
vfeedback_site = http://benny.ispi.net/vfeedback

## sections ##
[Topic]
title = Topic
post_date_format = m/d/y
comment_cutoff = 40
post_window_width  = 400
post_window_height = 300
post_form_window_width  = 400 
post_form_window_height = 450

And so on. This allows us to customize the app's behavior by just
changing the config file. It is also used to store colors used in the
template:

[Product Page]
fontColor_top_page_name = #000000
fontColor_top_page_name2 = #ffffff

> And a tpl_print() would be a nice shorthand.

Yes, true.

-Andrei
* Power corrupts. Atomic power corrupts atomically. *
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.