Login   Register  
PHP Classes
elePHPant
Icontem

File: doc/bltag_recordset.txt

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Daniel Andres Marjos  >  Extensible Template  >  doc/bltag_recordset.txt  >  Download  
File: doc/bltag_recordset.txt
Role: Documentation
Content type: text/plain
Description: Sample plugin documentation
Class: Extensible Template
Template engine extensible using sub-classes
Author: By
Last change:
Date: 6 years ago
Size: 1,160 bytes
 

Contents

Class file image Download
This plugin implements a fake <tpl:recordset></tpl:recordset> tag. The only purpose is to show you how to code your own
tag related plugins.

This tag has the following syntax:

<tpl:recordset 
    TYPE="rs_type" 
    INTERNALNAME="internal_name" 
    SELECTQUERY="query"
    >
....
....
....
....
</tpl:recordset>

the TYPE parameter can have one of the following values:

mysql|pgsql|msql|sqlite

INTERNALNAME is the name to be used inside the HTML block

SELECTQUERY would be the SQL select query that should return records 


HTML example:

<table width="100%" border="0" cellpadding="0">
<tpl:recordset type="mysql" internalname="users" selectquery="select * from users limit 0,10">
<tr><td>{users.user_id}</td><td>{users.user_name}</td></tr>
</tpl:recordset>
</table>

That HTML snippet would do a query against a database, and return up to 10 records from a "users" table
and would generate one <tr></tr> row in the table for each record returned by the query

Again, the tag plugin DOES NOT call any database function, as it has no host, username or password parameters,
although you can easily add those features. I'll let it as home work for you :D