I have the following template:

div id="table_form">
 <form name="${t/classname}" id="${t/classname}" target="${t/classname}.php" 
lang="PL" action="post">
 <table class="table_form" >
 <thead><td colspan="2">${t/caption}</td></thead>
  <tr tal:repeat="val t/colModel" >
   <td ><label for="${val/name}">${val/colNames}</label></td><td><div 
metal:use-macro="input" ></div></td>
  <tr><input type="submit" name="${t/submit_button}" id="${t/submit_button}" 
value="${t/add_item}" /> </tr>

<div metal:define-macro="input">
 <input type="text" name="${val/name}" id="${val/name}" value="${val/def}" 
maxlength="${val/length}" class="${" />

As we can see almost everywhere I have to use "t" prefix ${t/classname} in 
I passed an object like this:

$t = $curr->get_model_ext_info();
$tpl = new PHPTAL('tpl/table_form.tpl');
$tpl->t = $t;
echo $tpl->execute();

How can I get rid of "t" prefix($tpl->t) and access directly ex: ${classname}?
I dont want to manualy assign every tag($tpl->classname=$t->classname) to 
proper name, just do it in one line.

$t variable contains smething like this:
.... and so on.

Any ideas?
PHPTAL mailing list

Reply via email to