I. Presentation of TPLN |
TPLN is a template class wirtten in Php
for Php. |
Top |
II. Templates files |
||
1. Declaration of a variable |
||
The declaration of the variables makes itself with the help of the accolades {} in your file template
|
||
2. Declaration of a bloc |
||
The declaration of the blocks makes itself with the help of the accolades <> in your file template
|
||
3. Before beginning |
||
Before beginning, you need configure the present global variables in the TPLN_Cfg.php file within the TPLN directory.
|
||
Top |
III. The functions |
||
TPLN is a PHP class. It requires this declaration.
|
||
- Open() |
||
The Open() function serves to open the file template the file can have any extension (. htm. html. tpl,...). Open( string filename [, CACHED, int time ] )
|
||
Top | ||
- Parse() |
||
The Parse() function serves to replace
a variable defined in your file template. This function also possesses a parameter optional functions.
Parse( string item , string replace [, string functions ] )
|
||
Top | ||
- Loop() |
||
The Loop() function is applied to a block to signal its repetition. You can also write this manner Loop( [
string blocname ]
)
|
||
Top | ||
- EraseItem() |
||
the EraseItem() function serves to
erase a variable.
|
||
Top | ||
- EraseBloc() |
||
The EraseBloc() functions serves to
erase a bloc.
|
||
Top | ||
- ParseBloc() |
||
The ParseBloc() function serves to
replace a whole block with its included beacons.
|
||
Top | ||
- GetBlocInFile() |
||
The GetBlocInFile() function serves
to return a whole block of the template file.
|
||
Top | ||
- Write() |
||
The Write() function serves to print
the file template.
|
||
Top | ||
- Output() |
||
The Output() function serves to return
the content of the template file.
|
||
Top | ||
IV. The special functions MySQL |
||||
1. The Functions for MySQL |
||||
- SetHost(), SetLogin(), SetPassword(), SetBase() |
||||
The SetHost(), SetLogin(),
SetPassword(), SetBase() functions serve to initialize the
variables for the connection.
|
||||
Top | ||||
- DbConnect() |
||||
The DbConnect() function serves to connect to your MySQL database. DbConnect( )
|
||||
Top | ||||
- DbClose() |
||||
The DbClose() serves to disconnect to your MySQL database. DbClose( )
|
||||
Top | ||||
- DoQuery() |
||||
The DoQuery() function serves to make a query. DoQuery(string query )
|
||||
Top | ||||
- GetData() |
||||
The GetData() function serves to return
data of your query. GetData( [COUNT] )
|
||||
Top | ||||
- GetRowsCount() |
||||
The GetRowsCount() function serves to return the number of rows returned by the query. GetRowsCount( )
|
||||
Top | ||||
2. The ShowRecords() function |
||||
- ShowRecords() |
||||
ShowRecords() is a function that allows you to parse data from MySQL, you only have has create your template and the function takes care of all for you! Your template must be to configure as this:
ShowRecords( string query , int resultsbypage )
This function possesses its variable owners who are automatically parsed those must be present in the bloc <data></data> they are noted like this {_Variable}.
|
||||
Top | ||||
- SetNavLabels() |
||||
The SetNavLabels() function permits to replace the present text in _UrlBng, _UrlPrev, _UrlNext, _UrlEnd. SetNavLabels(string bngtxt , string prevtxt , string nexttxt , string endtxt )
|
Top |
V. The special functions of TPLN |
- AddChrono() |
The AddChrono() function permits
to be able to know the time of generation of the template. AddChrono([ ALL ]) If the ALL parameter passed then in parameter the stopwatch will return the sum of all the times or TPLN has been called, otherwise return the present session. |
Top |
- AddLogo() |
The AddLogo() function permits to
add the TPLN logo to your file. AddLogo() |
Top |
![]() |