Way to extend the template functions

[email protected] (Helmut Kleinhans) Tue, 29 Feb 2000 17:51:25 GMT
Newsgroups php.template
Message-ID <[email protected]>
Hi,


one Idee.


Include of pre-programmed php-functions. So you can make a template
that gets data from a database and shows it.

Example:


I have a php-script with the name get_date.php3 with the functions 
load_data(db_name,table_name) inside.
The functions returns a array of data with the values 
red,green,blue,white inside.

Then i make a template with the name show.tmp
whit this inside:


{{include get_data.php3}}

{{fcall function='load_data' params[1]='test' params[2]='test' 
return=#foo}}

<h1>Colors:</h1>
{{section loop1}}
	{{foo}}<br>
{{/section loop1}}


So the template will produce
 
<h1>Colors:</h1>
	red<br>
	green<br>
	blue<br>
	white<br>



-helli

[email protected]