我是 PHPTAL 的第一次用户,我无法使用 PHPTAL 为输入框提供值我有三个文件 1.index.php
require_once 'includes/lib/PHPTAL-1.2.2/PHPTAL.php';
// create a new template object
$template = new PHPTAL('components/epayroll/new/employeeView.xhtml');
require_once("employeeClass.php");
$people = array();
$people[] = new Person("foo");
// put some data into the template context
$template->title = 'The title value';
$template->people = $people;
// execute the template
try {
echo $template->execute();
}
catch (Exception $e){
echo $e;
}
2.empView.Xhtml
<td> <tal:block metal:define-macro="text"> <input name="${name}"
tal:attributes="id id | nothing" type="text" value="person/name"
/> </tal:block> </td>
3.empClass.php
class Person {
public $name;
function Person($name){
$this->name = $name;
}
}
请帮助我执行此操作的步骤。
感谢您的宝贵回复