Catalyst :: Controller :: FormBuilder视图不呈现输入字段

时间:2011-09-30 14:58:31

标签: perl catalyst formbuilder

我正在尝试在CPAN中使用Catalyst :: Controller :: FormBuilder中的示例视图,如下所示:

<!-- root/src/books/edit.tt -->
<head>
  <title>[% formbuilder.title %]</title>
  [% formbuilder.jshead %]<!-- javascript -->
</head>
 <body>
  [% formbuilder.start -%]
  <div id="form">
    [% FOREACH field IN formbuilder.fields -%]
    <p>
        <label>
           <span [% IF field.required %]class="required"[%END%]>[%field.label%]</span>
        </label>
      [% field.field %]
      [% IF field.invalid -%]
          <span class="error">
              Missing or invalid entry, please try again.
          </span>
      [% END %]
      </p>
    [% END %]
    <div id="submit">[% formbuilder.submit %]</div>
    <div id="reset">[% formbuilder.reset %]</div>
    </div>
  </div>
  [% formbuilder.end -%]
</body>

问题是我在页面上得到了字段标签,但没有得到输入字段:之前有没有人遇到过这个问题?

1 个答案:

答案 0 :(得分:0)

我发现了问题:文档中存在错误:

[% field.field %]

应为

[% field.tag %]

...