0

我正在尝试将 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>

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

4

1 回答 1

0

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

[% field.field %]

应该读作

[% field.tag %]

...

于 2011-09-30T15:59:04.547 回答