Way to extend the template functions

From: Date: Tue, 29 Feb 2000 17:51:25 +0000
Subject: Way to extend the template functions
Groups: php.template 
Request: Send a blank email to php-template+get-253@lists.php.net to get a copy of this message
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 helli@digiconcept.net

« previous php.template (#253) next »