PHP Classes

File: examples/template.php

Recommend this page to a friend!
  Classes of Everton da Rosa   XtPHP   examples/template.php   Download  
File: examples/template.php
Role: Example script
Content type: text/plain
Description: Example script
Class: XtPHP
General purpose library of utility classes
Author: By
Last change:
Date: 8 years ago
Size: 542 bytes


Class file image Download
//Exemplo de utilização de XtTemplate::merge()

require '../template.php';

//Os dados a serem mesclados
$arr = array(
'total' => 2
,'line' => array(
'codigo' => 1
,'nome' => 'fulano'
'codigo' => 2
,'nome' => 'beltrano'

//O Template
$tpl = "<table border=1>
<tr><td colspan=2>Total de linhas: {{total}}</td></tr>

XtTemplate::merge($arr, $tpl);//O resultado final