{
    "mode": "perldoc",
    "parameter": "CGI::FormBuilder::Template::Fast",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/perldoc/CGI%3A%3AFormBuilder%3A%3ATemplate%3A%3AFast/json",
    "generated": "2026-06-12T22:00:43Z",
    "synopsis": "my $form = CGI::FormBuilder->new(\nfields   => \\@whatever,\ntemplate => {\ntype => 'Fast',\nroot => '/path/to/templates',\n# use external files\ndefine => {\nform           => 'form.txt',\nfield          => 'field.txt',\ninvalidfield  => 'invalidfield.txt',\n},\n# or define inline\ndefinenofile => {\nform => '<html><head></head><body>$STARTFORM\n<table>$FIELDS</table>$SUBMIT $ENDFORM</body></html>',\n# etc.\n},\n},\n);",
    "sections": {
        "NAME": {
            "content": "CGI::FormBuilder::Template::Fast - FormBuilder interface to CGI::FastTemplate\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "my $form = CGI::FormBuilder->new(\nfields   => \\@whatever,\ntemplate => {\ntype => 'Fast',\nroot => '/path/to/templates',\n# use external files\ndefine => {\nform           => 'form.txt',\nfield          => 'field.txt',\ninvalidfield  => 'invalidfield.txt',\n},\n# or define inline\ndefinenofile => {\nform => '<html><head></head><body>$STARTFORM\n<table>$FIELDS</table>$SUBMIT $ENDFORM</body></html>',\n# etc.\n},\n},\n);\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This engine adapts FormBuilder to use \"CGI::FastTemplate\". Please read these docs carefully, as\nthe usage differs from other template adapters in several important ways.\n\nYou will need to define three templates: \"form\", \"field\", and \"invalidfield\". You can use\n\"define\" to point to external files (which is the recommended \"CGI::FastTemplate\" style), or\n\"definenofile\"/ \"defineraw\" to define them inline. The templates in \"definenofile\" take\nprecedence over \"defineraw\", and both of these take precedence over \"define\".\n\nmy $form = CGI::FormBuilder->new(\n# ...\ntemplate => {\ntype => 'FastTemplate',\nroot => '/path/to/templates',\ndefine => {\nform           => 'form.txt',\nfield          => 'field.txt',\ninvalidfield  => 'invalidfield.txt',\n},\n# or, you can define templates directly\ndefinenofile => {\nform => '<html><head></head><body>$STARTFORM<table>'\n'$FIELDS</table>$SUBMIT $ENDFORM</body></html>',\n# etc.\n},\n},\n# ...\n);\n\nIf you use \"define\" with external templates, you will probably also want to define your template\nroot directory with the \"root\" parameter.\n\nWithin each of the field templates, the following variables are available:\n\n$NAME         # $field->name\n$FIELD        # $field->tag   (HTML input tag)\n$VALUE        # $field->value (first value only!)\n$LABEL        # $field->label\n$COMMENT      # $field->comment\n$ERROR        # $field->error\n$REQUIRED     # $field->required ? 'required' : 'optional'\n\nAll the fields are processed in sequence; valid fields use the \"field\" template, and invalid\nfields the \"invalidfield\" template. The result from each of these is appended into the $FIELDS\nvariable, which you should use in your \"form\" template. In the \"form\" template, you also have\naccess to these variables:\n\n$TITLE        # title of the form\n$STARTFORM   # opening form tag\n$SUBMIT       # the submit button\n$RESET        # the reset button\n$ENDFORM     # closing form tag\n$JSHEAD      # validation JavaScript\n\nNote that since \"CGI::FastTemplate\" doesn't use anything other than simple scalar variables,\nthere are no variables corrosponding to the lists that other engines have (e.g. \"fields\" or\n\"options\" lists in \"TT2\" or \"Text::Template\").\n",
            "subsections": []
        },
        "SEE ALSO": {
            "content": "CGI::FormBuilder, CGI::FormBuilder::Template, CGI::FastTemplate\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "Copyright (c) 2005-2006 Peter Eichman <peichman@cpan.org>. All Rights Reserved.\n\nMaintained as part of \"CGI::FormBuilder\" by Nate Wiger <nate@wiger.org>.\n\nThis module is free software; you may copy this under the terms of the GNU General Public\nLicense, or the Artistic License, copies of which should have accompanied your Perl kit.\n",
            "subsections": []
        }
    },
    "summary": "CGI::FormBuilder::Template::Fast - FormBuilder interface to CGI::FastTemplate",
    "flags": [],
    "examples": [],
    "see_also": []
}