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>
  <tbody>
  <tr tal:repeat="val t/colModel" >
   <td ><label for="${val/name}">${val/colNames}</label></td><td><div 
metal:use-macro="input" ></div></td>
  </tr>
  <tr><input type="submit" name="${t/submit_button}" id="${t/submit_button}" 
value="${t/add_item}" /> </tr>
  </tbody>
  
  </table>
  </form>
</div>

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

As we can see almost everywhere I have to use "t" prefix ${t/classname} in 
variable.
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:
$t->classname
$t->name
$t->length
.... and so on.

Any ideas?
Greetings
Majkel
_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to