HTML-FormFu-2.01 000755 001751 001752 0 12331714662 12431 5 ustar 00carl carl 000000 000000 README 100644 001751 001752 604 12331714662 13352 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01
This archive contains the distribution HTML-FormFu,
version 2.01:
HTML Form Creation, Rendering and Validation Framework
This software is copyright (c) 2013 by Carl Franks.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
This README file was generated by Dist::Zilla::Plugin::Readme v5.015.
Changes 100644 001751 001752 67557 12331714662 14051 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01 2.01 2014-05-05
- Avoid uninitialized warning
2.00 2014-04-11
- New layout() method for customizing output of fields.
Any custom elements which override string() will likely need modified.
- Deprecated: reverse_single() and reverse_multi() are deprecated,
and warn when used.
If the new layout() is used, and there is no simple way to replicate
the behaviour, these methods will have no affect.
- TT template files changed - update them if you use a local copy.
Files updated: field
New files: field_layout, field_layout_block,
field_layout_checkboxgroup_field, field_layout_comment,
field_layout_contentbutton_field, field_layout_errors,
field_layout_field, field_layout_javascript, field_layout_label,
field_layout_label_field, field_layout_label_text,
field_layout_multi_field, field_layout_parser,
field_layout_select_field, field_layout_textarea_field.
Files deleted due to layout() changes: checkboxgroup_tag,
content_button, errors, input, input_tag, label, label_element,
multi, select_tag, textarea_tag
Unused files deleted: checkboxgroup.
- New Filter::ForceListValue addresses rt bug #90813
- render_label() and render_field() no longer require TT.
Include render_label() in tests.
- Fix typo in I18N::ja (Yusuke Watase).
- Bundle our own (renamed) copy of MooseX::Attribute::Chained to avoid
warnings under perl 5.19.x
1.00 2013-12-16
- TT template files changed - update them if you use a local copy.
Template file 'label_tag' renamed to 'label_element' - old file can
be deleted. 'field' file changed. New 'errors' file.
- TT no longer listed as a prerequisite. If you use the TT files,
you must add 'Template' to your own app's prereqs.
- Element::reCAPTCHA and Constraint::reCAPTCHA moved out to separate
distribution.
- HTML::FormFu::MultiForm moved out to separate distribution.
- auto_container_class(), auto_label_class(), auto_comment_class(),
auto_container_error_class(), auto_container_per_error_class(),
auto_error_class() no longer have default values.
See "RESTORING LEGACY HTML CLASSES" in HTML::FormFu docs to restore
previous behaviour.
- auto_label_class() no longer adds class to container.
auto_label_class() now adds class to label tag.
new auto_container_label_class() adds class to container.
See "RESTORING LEGACY HTML CLASSES" in HTML::FormFu docs to restore
previous behaviour.
- auto_comment_class() no longer adds class to both container and comment.
auto_comment_class() now only adds class to comment tag.
new auto_container_comment_class() adds class to container.
See "RESTORING LEGACY HTML CLASSES" in HTML::FormFu docs to restore
previous behaviour.
- Bug fix: param_value() form method now matches documented behaviour -
returns undef when field has errors. (Reported by Hailin Hu).
- New Element::Email and Element::URL HTML5 input fields.
- Role::Element::Input has new datalist_options(), datalist_values(),
datalist_id() and auto_datalist_id() methods to support HTML5 datalists.
auto_datalist_id() is an inherited accessor which can be set on the
Form, MultiForm, or Block.
- Form and Elements has new title() attribute short-cut.
- Constraint::Regex has new anchored() accessor.
- New Input attribute accessors: placeholder(), pattern(), autocomplete().
- New Input boolean attribute accessors: autofocus(), multiple(), required().
- New Field inherited accessors: auto_container_per_error_class(),
auto_error_container_class(), auto_error_container_per_error_class(),
error_tag(), error_container_tag
- Constraints have new experimental method fetch_error_message().
- All field elements have new method error_filename().
- default_args() now supports 'Block', 'Field', 'Input' pseudo-elements,
'|' alternatives, and '+' and '-' ancestor modifiers.
- New Czech (cs) I18N translation by Jan Grmela.
- mk_inherited_accessors() now also creates a *_no_inherit() method.
- Experimental new roles() form method.
- form methods start(), end() now respect render_method - no longer
force use of tt templates.
- Bug fix: del_attribute() on empty attribute no longer sets the attribute.
- All attribute accessors generated with mk_attrs() now have *_loc variants.
- form methods start(), end() now respect render_method - no longer
force use of tt templates.
- Tests now always require Test::Aggregate::Nested.
Re-enable aggregate tests on Win32.
Don't run all tests twice under both aggregate and t/ (doh!)
0.09010 2012-10-05
- Internal changes - all Repeatable/nested_name munging is moved out of
HTML::FormFu::Element::Repeatable into individual constraints
0.09009 2012-09-29
- Make sure object can('checked') before calling checked() (colinnewell)
- Updated Repeatable control to update id_field on DBIC::Unique if present
- ComboBox new get_select_field_nested_name(), get_text_field_nested_name()
accessors.
- Fieldset new legend_attributes() method.
- New form_error_message_class() method.
- Constraint 'when' callback now receives $constraint as 2nd argument.
0.09007 2012-01-23
- bump MooseX::Attribute::Chained version
0.09006 2012-01-23
- fixed deprecation warnings of MX::Attribute::Chained (bricas)
- Added placeholder attributes for types Text and Textarea with L10N support.
- Added L10N support for 'prefix' attributes for types Date and DateTime.
- Added 'attributes' support to types Date and DateTime.
0.09005 2011-09-06
- bump version of prereq CGI to 3.37 to make all tests pass
0.09004 2011-08-26
- skip aggregate.t on Win32
- no functional changes to HTML::FormFu
0.09003_02 2011-08-25
- disable Test::Aggregate on Win32
0.09003_01 2011-05-11
- using Test::Aggregate for the test suite if installed
tests finish now in seconds instead of minutes
0.09003 2011-05-10
- fixed regression in Model::HashRef introduced in 0.09000
0.09002 2011-03-21
- Hopefully fix IO::Interactive dependency properly
0.09001 2011-03-31
- Fix IO::Interactive dependency
0.09000 2011-03-29
- Codebase changed to use Moose - massive internal changes - any custom
Elements, Constraints, etc will require changes.
See advice on mailing list:
http://www.mail-archive.com/html-formfu@lists.scsys.co.uk/msg02325.html
Or ask for help on the mailing list:
http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/html-formfu
- Bug fix: was a fatal error when a value was submitted for Label element
(code called delete_nested_hash_value instead of deleted_nested_hash_key).
- Bug fix: RT#65728 Filter::Split shouldn't return a value if no value was
submitted.
- Bug fix: Element::Date now uses default() in preference to
default_natural(). RT#65727
- DateTime elements, minutes and seconds have new 'interval' option.
- Now only delete submitted value if there's no other field on the form with
the same name.
- load_config_file(stem) now honours the include path order, to mimic TT
behaviour.
0.08002 2010-09-22
- Incompatible Change: removed all previously deprecated methods.
- Incompatible Change: HTML::FormFu::QueryType::Catalyst
File uploads under Catalyst no longer have copy_to(), link_to() and
catalyst_upload() methods
- Deprecated passing multiple arguments to many methods, where they were
being implicitly converted to a hash-ref or array-ref.
A warning is now issued.
- Fix: Constraint::Equal with not(1) set no longer sets an error when both
field values are empty strings.
- Fix: An empty block with nested_name set, containing Label elements and
no other fields, was causing the block's nested_name to be added to
$form->valid(). RT #54967
- Constraints that inherit from HTML::FormFu::Constraint::_others have a new
'other_siblings' option, which auto-generates the 'others' list.
- Constraint 'when' condition now supports new 'fields' and 'any_field'
options.
- Bumped required version of DateTime to 0.54 - needed to pass tests under
Test::More 0.96.
0.07003 2010-08-02
- Fix: Group element now escapes each items attributes, label_attributes
and container attributes (based on by patch by Jeff Dairiki).
- Fix: If using default_natural, use default_datetime_args{set_time_zone}
if it's also set (Radek).
- Filter::HTMLScrubber extra functionality.
- Update _merge_hashes() so it can also merge arrays and hashes into a new
array. This is necessary to allow default_args() to define a different
ref-type than the element or processor which uses its values.
- Update Element::reCAPTCHA tests after changes to Captcha::reCAPTHCA
(bump dependency version).
0.07002 2010-06-24
- Fix: Use MRO::Compat before mro to support perl 5.8
- Fix: Date and ComboBox elements need to run deflators before trying to
use any default value - reported by Matija Grabnar.
- Overloading comparisons no longer assume both arguments are a blessed
object - change needed for latest Test::More (Test-Simple-0.95_02)
(RT#57747)
- Change Element::Date to not use deprecated DateTime::Locale methods.
- Bump DateTime::Locale and DateTime::Format::Strptime required versions
as DateTime::Locale Changes file has no mention of when the methods
we're now using were added.
- Removed Regexp::Copy from prereqs.
0.07001 2010-05-16
- No changes - cpan indexer failed for last release
0.07000 2010-05-16
- Change of behaviour: default_args() values are now applied to any object
inheriting from the specified type, rather than just an instance of that
type. Old behaviour is still supported with a minor change, see docs for
details. - (Daniel Hilton)
- Change of behaviour: default_args() key/values are now applied in order
of inheritance, rather than the random order returned by keys()
- New reverse_single attribute for all field elements. New reverse_group
attribute for Checkboxgroup and Radiogroup elements. (Ronald Kimball)
- New default_datetime_args() method on Date and DateTime elements.
- Element::DateTime now supports a 'second' select menu.
- Allow empty string as default value for Date element. (Ronald Kimball)
- Now use Clone instead of Storable (ntyni@iki.fi).
- Change from Class::C3 to mro, to get built-in support in perl >= 5.9
- New Bulgarian translation (Kamen Naydenov).
- Fix bad links and markup in POD. (Ronald Kimball)
- Fix spelling errors in POD (Ansgar Burchardt)
- Documented Element::Textarea cols() and rows() methods.
- Bump Config::Any requirement to version 0.18 for YAML::XS support
- Refactored ObjectUtil (Daniel Hilton)
0.06001 2010-01-08
- Fixed issue with Model::HashRef where form fields with an underscore
and overlapping name (e.g. 'foo' and 'foo_bar') were causing problems
- Fix test suite year issue.
0.06000 2009-12-10
- New get_parent() method that traverses the parent hierarchy, returning
the first parent that matches the supplied options.
- Date element, year menu now supports 'reverse' option to reverse order
of year list. - patch from Ozum Eldogan.
- New Element::Block method auto_block_id().
- New only_on_reps() method for constraints on fields within a Repeatable
element. Causes the constraint to only be run if the field's
repeatable_count() matches one of the set values.
- New Repeatable::Any constraint.
- Bugfix: after submission, group-type fields were getting the wrong value
when multiple fields had the same name. - patch by Doug Orleans.
- Bugfix: If a field in a Repeatable block had an error, all copies of that
field were displaying the error. - report by Doug Orleans.
- Repeatable elements inside a Repeatable element, now works without
having nested_name set.
- Performance fix: change all uses of eval() to check for array/hash-refs
to Scalar::Util::reftype() instead. - Was causing a hit for group-type
fields with large numbers of options. - initial patch by Steve Nolte.
- Bump required version of Data::Visitor to 0.26
- Minor pod fixes.
0.05004 2009-12-02
- No changes - last release was built on Windows and didn't pass pause's
indexer checks.
0.05003 2009-11-29
- Fix YAML test files for YAML::XS compatibility
0.05002 2009-11-25
- Fix handling of counter_name in nested-repeatables.
- Element::reCAPTCHA new constraint_args() method to pass options to the
automatically-created Constraint::reCAPTCHA.
- Model::HashRef->create() now works with submitted input.
- Kwalitee updates. (RT #47998)
- Pod fixes. (RT #49120, #49114, #46363)
0.05001 2009-07-03
- get_field(s), get_element(s), get_all_elements() now support a Regex
object for any conditional argument.
- Model::Hashref now searches for Multi and Repeatable elements using the
regexes qr/Multi/ and qr/Repeatable/ to all for custom/derived classes.
- New $form->add_localize_object_from_class() method.
- New Element::Label.
- Bugfix: DateTime element, hour/minute select menus didn't display correct
value when hour/minute value was less than 10, and $form->process()
wasn't called after $form->model->default_values().
- Silence "undef value in string eq" warnings.
0.05000 2009-05-26
- Nested repeatable blocks now create field names such as
'foo_1.bar_1' rather than 'foo.bar_1_1', to assist client-side scripting.
0.04002 2009-05-08
- Incompatible Change: Element::Repeatable->repeat() now defaults to 1
instead of 0. This allows empty Repeatables.
- Fix test failures on Win32.
- During Element::Repeatable->process() call children's process() before
$self->repeat().
- Support nested Repeatable elements.
- Ensure plugins are correctly cloned.
0.04001 2009-04-15
- Fix handling of arguments to plugin().
- HTML::FormFu::Model::HashRef supports now empty repeatable elements.
- vertically-aligned CSS example updated.
0.04000 2009-03-26
- Incompatible Change: plugins process() method is now run *after*
elements' process() method.
- Incompatible Change: Button element no longer sets retain_default(1) -
now sets force_default(1). Fixes bug where multiple buttons with same
name were getting the wrong value after being redisplayed after errors.
- New pre_process() plugin method that runs at the same time as the old
process() hook.
- New Model::HashRef.
- New inherited method locale() available on forms, blocks and fields.
- New Element::Number.
- New Deflators: FormatNumber, PathClassFile, Callback.
- New Filter::FormatNumber.
- New Inflator::Callback.
- New Norwegian I18N translation.
- Updated vertically-aligned CSS.
- config_file_path() now supports a list of directories.
- Checkboxgroup + Radiogroup elements others() method now supports
'container_attributes' hash-key
- Constraint when() condition no longer demands a 'value' or 'values'
key - if it's missing, the constraint will pass on any true value.
- Bugfix: _Group elements - ensure 'empty_first' gets set before any
'options', 'values', 'value_range'.
- Bugfixes for constraint attach_errors_to_base(),
attach_errors_to_others().
- Bugfix: Repeatable blocks now correctly rename nested-names in
constraints' others().
- Bugfix: Repeatable blocks now rename field names in constraints' when().
- Bugfix: Repeatable blocks now reparent fields' plugins.
0.03007 2008-12-08
- Remove Test::Aggregate - seeing test failures under perl 5.8.x
0.03006 2008-12-03
- New DateTime element.
- New MinRange, MaxRange, File::MinSize, File::MaxSize constraints to
provide more specific error messages.
- New File::Size constraint methods: min_kilobyte(), max_kilobyte(),
min_megabyte(), max_megabyte().
- New config_file_path() method, used by load_config_file() and
load_config_filestem().
- New field_order() method for Date elements.
- New I18N translations for Romanian, Russian, Ukranian.
- New MultiForm system for multi-page forms (not yet documented, file
upload tests skipped due to test problems on MS Win32).
- Length, Range and File::Size constraints now pass min() and max()
values as I18N args, for use in strings.
- DependOn and Equal constraints now pass the root field label as I18N
arg, for use in strings.
- Checkbox + Radio elements now default to value(1).
- Constraint when() method now works with nested_names().
- Using test aggregate to speed-up tests.
0.03005 2008-09-08
- New ComboBox element.
- Don't use Pod::Help - some people were getting test failures.
0.03004 2008-09-03
- New reCAPTCHA element.
- New pt_br (Brazilian Portuguese) translation from Daniel Nicoletti.
- New load_config_filestem() method for loading config files without
having to specify the file extension.
- New html_formfu_dumpconf.pl script, for viewing config files structure.
- Assorted optimizations, providing over 20% runtime speedup.
- Radio element now inherits from Checkbox, to remove duplicated code.
- Radiogroup element now inherits from Checkboxgroup, to remove duplicated
code.
- checkboxgroup_tag template file has been removed - Checkboxgroup now just
uses radiogroup_tag file.
- All non-english I18N packages now correctly "use utf8;"
- load_config_file() now switches on Config-General's UTF8, so that files
are correctly decoded.
- Regex filter now has an eval() method, which if true, eval's the
contents of replace(), to allow the use of $1 variables or any other
perl expression.
- Allow languages() to be a single value, rather than just an arrayref.
- CompoundJoin filter now ignores empty values.
- examples/unicode updated.
- Manual-Unicode cat. config examples changed to use MyApp->config().
- Stop warnings for undefined attributes - reported by Rod Taylor.
- Documentation improvements by Ansgar Burchardt.
0.03003 2008-08-21
- Form and elements inside template files now have access to original
object via self.object
- Having a named Multi block within a Block with nested_name set, now works.
- New Element method is_block() which is true for Block elements.
- Multi no longers sets is_field(0) - it's now true for both is_field() and is_block().
- prereqs - set minimum version of Exporter.pm that exports import()
0.03002 2008-08-11
- Deprecate element_defaults() method.
- New default_args() method.
- New CompoundSprintf filter.
- New DateTime constraint.
- New field method default_empty_value().
- New I18N translations for Danish, French and Italian.
- Added time_zone support to Inflator::DateTime
- Documented that process() must be called before render() - this has
been the case since 0.03000.
0.03001 2008-06-20
- Require version 0.38 of DateTime, for string overloading support.
0.03000 2008-06-19
- Field container_tag() now defaults to 'div' rather than 'span' to provide
better layout without CSS.
- Multi block no longer sets container_tag() to 'span' - defaults to 'div'.
- HTML::FormFu::Model::DBIC moved out into a separate distribution.
- Models now accessed through new form method: model(), with accompanying
methods: default_model() and model_config.
- Deprecated form methods: model_class(), defaults_from_model(),
save_to_model().
- Model methods renamed to: default_model(), default_values() and update().
- New model method: create().
- Deprecated element method: db().
- Bugfixes for perl 5.10.0 (missing imports).
- Bugfix: insert_before() and insert_after() now check if the object is
already a child, and if so, removes it first. Reported by Ferruccio
Zamuner.
- Bugfix: update() many_to_many multi-value fields where
'default_column' included the table name (or 'me.') failed.
- Bugfix: make inflators work with multiple submitted values.
- Bugfix for Bool constraint: use '?' quantifier, not '*'.
- Bugfix in Email constraint: ensure Email::Valid->address() is called in
scalar context.
- New Split and CompoundJoin filters.
- New CompoundDateTime inflator.
- New CompoundSplit and CompoundDateTime deflators.
- New Plugin system (see tests, not yet documented) and StashValid plugin.
- New form methods: stash_valid(), params_ignore_underscore() and
tmp_upload_dir().
- New method for _Group fields: empty_first_label().
- Multi->render_data() now builds itself before it's children, so that
deflators on the Multi work.
- insert_before() and insert_after() now first removes the object if it's
already a child of the target.
- Callback filter and transformers now receive $params as a 2nd argument.
- _Group field options() now supports value_xml, value_loc, label_xml and
label_loc args.
- get_* methods (fields, elements, constraints, etc) now accept any valid
method-name as a search parameter.
- add default_natural() method to Date element, allowing the use of
DateTime::Format::Natural to parse dates such as "today" or "yesterday".
- when() method for Constraints can now accept a callback
- Transformer callbacks now get $params as second argument (as Constraints
aready were getting)
- Form method add_valid() now expects a full nested-name.
- auto_id() now translates "%n" into the full nested-name.
- Add a END block to DBICTestLib that cleans up the t/test.db
0.02004 2008-02-22
- Incompatible Change: $upload->headers no longer returns a hashref, it now
returns a HTTP::Headers object.
Tests for $upload->headers->{'Content-Type'} changed to
$upload->headers->content_type.
Tests for $upload->headers->{'Content-Length'} changed to
$upload->headers->content_length.
- Catalyst upload object now provides basename(), copy_to(), link_to(),
size(), tempname() and type() methods which delegate to the
Catalyst::Request::Upload object.
- The original Catalyst::Request::Upload objects can be retrived with the
catalyst_upload() method.
- CGI and CGI::Simple upload objects provide size() and type() methods.
- New Constraints: File::Size, File::MIME and File.
- 'Required' and other constraints now work with file uploads.
- Spanish I18N added.
- Support for DBIx::Class schema methods which don't correspond to a
database column or relationship.
- Fixed test failures due to hardcoded date element output expecting the
year 2007.
- Fixed circular references in upload objects.
0.02003 2007-12-20
- Bugfix for has-many rels in defaults_from_model()
- Added Template.pm back into prereqs
- Repeatable element, increment_field_names() is now true by default
- Fixed javascript rendering in _Field
0.02002 2007-12-12
- Fixes required for perl 5.10.0
0.02001 2007-12-12
- Bugfix for save_to_model() in HTML::FormFu::Model::DBIC
0.02000 2007-12-12
- New HTML::FormFu::Model::DBIC module to replace DBIx::Class::HTML::FormFu
- New Repeatable block element
- New "nested" params support. Form and Block elements have a new
nested_name() method. Field elements have new nested(), nested_name()
and nested_names() methods. Doesn't require CGI::Expand or
Catalyst::Plugin::NestedParams
- Uses new "string" renderer by default - doesn't use template files,
Generated markup still exactly the same,
Set render_method("tt") to use the template files (old behaviour),
render_class_args() renamed to tt_args(),
Template files now installed into @INC path by File::ShareDir,
INCLUDE_PATH no longer set by default
- New Checkboxgroup element. Works much like Radiogroup, but with
checkboxes
- Support multiple yaml documents in a single file - calls populate()
once for each document
- Date element now uses names of the form "date_day" instead of
"date.day", so as to not conflict with the new nested-params. This
should only affect you if your client-side code (CSS, JS) references
the field names
- Group elements (Select, Radiogroup, Checkboxgroup) now support a
'label_loc' argument, to provide the item labels via localize()
- *_loc() methods now accept an arrayref argument, to allowing setting
in YAML config files
- render() now returns a string, not an object.
$form->render->start_form() must be changed to $form->start(),
$form->render->end_form() must be changed to $form->end,
$form->render->field('foo') must be changed to $form->get_field('foo'),
$form->render->hidden_fields() must be changed to $form->hidden_fields()
- Bugfix: OutputProcessor::Indent was indenting closing tag, when it's
value was empty (RT 30239)
- Bugfix: Objects were getting wrong parents during clone() and
auto_fieldset()
0.01006 2007-10-23
- render_class_args->{INCLUDE_PATH} now defaults to 'root' if it's not
set - previously was only set if the entire render_class_args hashref
was empty
- New StripWhitespace OutputProcessor
- New CopyValue Filter
- New Cookbook and Unicode manual pages
- New unicode example Catalyst application
- New portuguese I18N translation
- Callback Filters, Constraints and Validators now accept a fully
qualified subroutine name instead of a code-ref
- Date element month names from DateTime::Locale are run through ucfirst
- Documentation improvements
- Bugfix: forced errors are now displayed
0.01005 2007-09-21
- New Indent "output processor" to pretty-print output
- New force_default() method on fields
- New when() method for all Constraints
- Behaviour change for MinMaxFields Constraint
0.01004 2007-09-12
- New html_formfu_deploy.pl helper program
- AutoSet Constraint now works with Select optgroups
- Added vertically-aligned CSS example
- Fix circular reference / memory leak
- Documentations fixes / additions
- require v0.7901 of DateTime::Format::Builder to fix memory leak
0.01003 2007-08-22
- Add missing prereq to Makefile.PL
0.01002 2007-08-22
- Fixed missing imports causing errors with perl 5.9.x
0.01001 2007-08-22
- First non-dev release
- All Element names now follow CamelCase convention
- Key format of I18N files changed
- New Date element
- Use Class::C3 instead of SUPER
- Automatically set UTF-8 encoding on TT
- Support for Template::Alloy instead of TT
0.01000_02 2007-07-02
- Updated templates in tt_files.pm - 0.01000_02 was out of date
0.01000_02 2007-07-02
- Added YAML::Syck to dependencies
- Pod fix
0.01000_01 2007-06-29
- First CPAN dev release
LICENSE 100644 001751 001752 43652 12331714662 13551 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01 This software is copyright (c) 2013 by Carl Franks.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Terms of the Perl programming language system itself
a) the GNU General Public License as published by the Free
Software Foundation; either version 1, or (at your option) any
later version, or
b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
This software is Copyright (c) 2013 by Carl Franks.
This is free software, licensed under:
The GNU General Public License, Version 1, February 1989
GNU GENERAL PUBLIC LICENSE
Version 1, February 1989
Copyright (C) 1989 Free Software Foundation, Inc.
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The license agreements of most software companies try to keep users
at the mercy of those companies. By contrast, our General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. The
General Public License applies to the Free Software Foundation's
software and to any other program whose authors commit to using it.
You can use it for your programs, too.
When we speak of free software, we are referring to freedom, not
price. Specifically, the General Public License is designed to make
sure that you have the freedom to give away or sell copies of free
software, that you receive source code or can get it if you want it,
that you can change the software or use pieces of it in new free
programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of a such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must tell them their rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License Agreement applies to any program or other work which
contains a notice placed by the copyright holder saying it may be
distributed under the terms of this General Public License. The
"Program", below, refers to any such program or work, and a "work based
on the Program" means either the Program or any work containing the
Program or a portion of it, either verbatim or with modifications. Each
licensee is addressed as "you".
1. You may copy and distribute verbatim copies of the Program's source
code as you receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice and
disclaimer of warranty; keep intact all the notices that refer to this
General Public License and to the absence of any warranty; and give any
other recipients of the Program a copy of this General Public License
along with the Program. You may charge a fee for the physical act of
transferring a copy.
2. You may modify your copy or copies of the Program or any portion of
it, and copy and distribute such modifications under the terms of Paragraph
1 above, provided that you also do the following:
a) cause the modified files to carry prominent notices stating that
you changed the files and the date of any change; and
b) cause the whole of any work that you distribute or publish, that
in whole or in part contains the Program or any part thereof, either
with or without modifications, to be licensed at no charge to all
third parties under the terms of this General Public License (except
that you may choose to grant warranty protection to some or all
third parties, at your option).
c) If the modified program normally reads commands interactively when
run, you must cause it, when started running for such interactive use
in the simplest and most usual way, to print or display an
announcement including an appropriate copyright notice and a notice
that there is no warranty (or else, saying that you provide a
warranty) and that users may redistribute the program under these
conditions, and telling the user how to view a copy of this General
Public License.
d) You may charge a fee for the physical act of transferring a
copy, and you may at your option offer warranty protection in
exchange for a fee.
Mere aggregation of another independent work with the Program (or its
derivative) on a volume of a storage or distribution medium does not bring
the other work under the scope of these terms.
3. You may copy and distribute the Program (or a portion or derivative of
it, under Paragraph 2) in object code or executable form under the terms of
Paragraphs 1 and 2 above provided that you also do one of the following:
a) accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of
Paragraphs 1 and 2 above; or,
b) accompany it with a written offer, valid for at least three
years, to give any third party free (except for a nominal charge
for the cost of distribution) a complete machine-readable copy of the
corresponding source code, to be distributed under the terms of
Paragraphs 1 and 2 above; or,
c) accompany it with the information you received as to where the
corresponding source code may be obtained. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form alone.)
Source code for a work means the preferred form of the work for making
modifications to it. For an executable file, complete source code means
all the source code for all modules it contains; but, as a special
exception, it need not include source code for modules which are standard
libraries that accompany the operating system on which the executable
file runs, or for standard header files or definitions files that
accompany that operating system.
4. You may not copy, modify, sublicense, distribute or transfer the
Program except as expressly provided under this General Public License.
Any attempt otherwise to copy, modify, sublicense, distribute or transfer
the Program is void, and will automatically terminate your rights to use
the Program under this License. However, parties who have received
copies, or rights to use copies, from you under this General Public
License will not have their licenses terminated so long as such parties
remain in full compliance.
5. By copying, distributing or modifying the Program (or any work based
on the Program) you indicate your acceptance of this license to do so,
and all its terms and conditions.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the original
licensor to copy, distribute or modify the Program subject to these
terms and conditions. You may not impose any further restrictions on the
recipients' exercise of the rights granted herein.
7. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of the license which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
the license, you may choose any version ever published by the Free Software
Foundation.
8. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
Appendix: How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.
To do so, attach the following notices to the program. It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.
Copyright (C) 19yy
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) 19xx name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the
appropriate parts of the General Public License. Of course, the
commands you use may be called something other than `show w' and `show
c'; they could even be mouse-clicks or menu items--whatever suits your
program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the
program `Gnomovision' (a program to direct compilers to make passes
at assemblers) written by James Hacker.
, 1 April 1989
Ty Coon, President of Vice
That's all there is to it!
--- The Artistic License 1.0 ---
This software is Copyright (c) 2013 by Carl Franks.
This is free software, licensed under:
The Artistic License 1.0
The Artistic License
Preamble
The intent of this document is to state the conditions under which a Package
may be copied, such that the Copyright Holder maintains some semblance of
artistic control over the development of the package, while giving the users of
the package the right to use and distribute the Package in a more-or-less
customary fashion, plus the right to make reasonable modifications.
Definitions:
- "Package" refers to the collection of files distributed by the Copyright
Holder, and derivatives of that collection of files created through
textual modification.
- "Standard Version" refers to such a Package if it has not been modified,
or has been modified in accordance with the wishes of the Copyright
Holder.
- "Copyright Holder" is whoever is named in the copyright or copyrights for
the package.
- "You" is you, if you're thinking about copying or distributing this Package.
- "Reasonable copying fee" is whatever you can justify on the basis of media
cost, duplication charges, time of people involved, and so on. (You will
not be required to justify it to the Copyright Holder, but only to the
computing community at large as a market that must bear the fee.)
- "Freely Available" means that no fee is charged for the item itself, though
there may be fees involved in handling the item. It also means that
recipients of the item may redistribute it under the same conditions they
received it.
1. You may make and give away verbatim copies of the source form of the
Standard Version of this Package without restriction, provided that you
duplicate all of the original copyright notices and associated disclaimers.
2. You may apply bug fixes, portability fixes and other modifications derived
from the Public Domain or from the Copyright Holder. A Package modified in such
a way shall still be considered the Standard Version.
3. You may otherwise modify your copy of this Package in any way, provided that
you insert a prominent notice in each changed file stating how and when you
changed that file, and provided that you do at least ONE of the following:
a) place your modifications in the Public Domain or otherwise make them
Freely Available, such as by posting said modifications to Usenet or an
equivalent medium, or placing the modifications on a major archive site
such as ftp.uu.net, or by allowing the Copyright Holder to include your
modifications in the Standard Version of the Package.
b) use the modified Package only within your corporation or organization.
c) rename any non-standard executables so the names do not conflict with
standard executables, which must also be provided, and provide a separate
manual page for each non-standard executable that clearly documents how it
differs from the Standard Version.
d) make other distribution arrangements with the Copyright Holder.
4. You may distribute the programs of this Package in object code or executable
form, provided that you do at least ONE of the following:
a) distribute a Standard Version of the executables and library files,
together with instructions (in the manual page or equivalent) on where to
get the Standard Version.
b) accompany the distribution with the machine-readable source of the Package
with your modifications.
c) accompany any non-standard executables with their corresponding Standard
Version executables, giving the non-standard executables non-standard
names, and clearly documenting the differences in manual pages (or
equivalent), together with instructions on where to get the Standard
Version.
d) make other distribution arrangements with the Copyright Holder.
5. You may charge a reasonable copying fee for any distribution of this
Package. You may charge any fee you choose for support of this Package. You
may not charge a fee for this Package itself. However, you may distribute this
Package in aggregate with other (possibly commercial) programs as part of a
larger (possibly commercial) software distribution provided that you do not
advertise this Package as a product of your own.
6. The scripts and library files supplied as input to or produced as output
from the programs of this Package do not automatically fall under the copyright
of this Package, but belong to whomever generated them, and may be sold
commercially, and may be aggregated with this Package.
7. C or perl subroutines supplied by you and linked into this Package shall not
be considered part of this Package.
8. The name of the Copyright Holder may not be used to endorse or promote
products derived from this software without specific prior written permission.
9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
The End
dist.ini 100644 001751 001752 3444 12331714662 14163 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01 name = HTML-FormFu
author = Carl Franks
license = Perl_5
copyright_holder = Carl Franks
copyright_year = 2013
version = 2.01
[Prereqs]
perl = 5.008001
; this is the lowest version of Exporter I can identify that exports import()
; it's bundled with perl 5.83
; version 5.567 that ships with perl 5.82 is no good
Exporter = 5.57
Carp = 0
Class::MOP::Method = 0
Clone = 0.31
Config::Any = 0.18 ; 0.10 - supports multi-doc config files
; 0.18 - prefers YAML::XS for YAML
Cwd = 0
Data::Visitor = 0.26 ; when it dumped Any::Moose for Moose
Data::Visitor::Callback = 0
DateTime = 0.54 ; required for string overloading
DateTime::Format::Strptime = 1.2000
DateTime::Format::Builder = 0.7901 ; fixes memory leaks
DateTime::Format::Natural = 0
DateTime::Locale = 0.45
Email::Valid = 0
Encode = 0
Fatal = 0
File::Copy = 0
File::Find = 0
File::ShareDir = 0
File::Spec = 0
File::Temp = 0
Hash::Flatten = 0
HTML::Scrubber = 0
HTML::TokeParser::Simple = 3.14
HTTP::Headers = 1.64
IO::File = 0
List::MoreUtils = 0
List::Util = 0
Locale::Maketext = 0
Module::Pluggable = 0
Moose = 1.00 ; Reasonable default until we get test results
Moose::Role = 0
Moose::Util = 0
MooseX::Aliases = 0
; MooseX::Attribute::Chained = 1.0.1 ; we're currently using a forked copy to avoid 'deprecated' warnings
Number::Format = 0
Readonly = 0
Regexp::Common = 0
Path::Class::File = 0
Scalar::Util = 0
Storable = 0
Task::Weaken = 0 ; to ensure Scalar::Util was built with weaken()
YAML::XS = 0.32
[Prereqs / TestRequires]
CGI = 3.37 ; for file POST tests
POSIX = 0
Test::More = 0.92
Test::Aggregate::Nested = 0.371
Test::Exception = 0
[MetaNoIndex]
directory = examples
[Test::Perl::Critic]
[PodCoverageTests]
[PodSyntaxTests]
[PkgVersion]
[NextRelease]
format = %v %{yyyy-MM-dd}d
[Repository]
[@Basic]
META.yml 100644 001751 001752 3103 12331714662 13760 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01 ---
abstract: 'HTML Form Creation, Rendering and Validation Framework'
author:
- 'Carl Franks '
build_requires:
CGI: '3.37'
POSIX: '0'
Test::Aggregate::Nested: '0.371'
Test::Exception: '0'
Test::More: '0.92'
configure_requires:
ExtUtils::MakeMaker: '6.30'
File::ShareDir::Install: '0.03'
dynamic_config: 0
generated_by: 'Dist::Zilla version 5.015, CPAN::Meta::Converter version 2.140640'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: '1.4'
name: HTML-FormFu
no_index:
directory:
- examples
requires:
Carp: '0'
Class::MOP::Method: '0'
Clone: '0.31'
Config::Any: '0.18'
Cwd: '0'
Data::Visitor: '0.26'
Data::Visitor::Callback: '0'
DateTime: '0.54'
DateTime::Format::Builder: '0.7901'
DateTime::Format::Natural: '0'
DateTime::Format::Strptime: '1.2000'
DateTime::Locale: '0.45'
Email::Valid: '0'
Encode: '0'
Exporter: '5.57'
Fatal: '0'
File::Copy: '0'
File::Find: '0'
File::ShareDir: '0'
File::Spec: '0'
File::Temp: '0'
HTML::Scrubber: '0'
HTML::TokeParser::Simple: '3.14'
HTTP::Headers: '1.64'
Hash::Flatten: '0'
IO::File: '0'
List::MoreUtils: '0'
List::Util: '0'
Locale::Maketext: '0'
Module::Pluggable: '0'
Moose: '1.00'
Moose::Role: '0'
Moose::Util: '0'
MooseX::Aliases: '0'
Number::Format: '0'
Path::Class::File: '0'
Readonly: '0'
Regexp::Common: '0'
Scalar::Util: '0'
Storable: '0'
Task::Weaken: '0'
YAML::XS: '0.32'
perl: '5.008001'
resources:
repository: git://github.com/fireartist/HTML-FormFu.git
version: '2.01'
MANIFEST 100644 001751 001752 100211 12331714662 13676 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01 # This file was automatically generated by Dist::Zilla::Plugin::Manifest v5.015.
Changes
LICENSE
MANIFEST
MANIFEST.SKIP
META.yml
Makefile.PL
README
bin/html_formfu_deploy.pl
bin/html_formfu_dumpconf.pl
dist.ini
examples/unicode/Changes
examples/unicode/Makefile.PL
examples/unicode/README
examples/unicode/database.sql
examples/unicode/lib/unicode.pm
examples/unicode/lib/unicode/Controller/Root.pm
examples/unicode/lib/unicode/Model/DB.pm
examples/unicode/lib/unicode/Schema.pm
examples/unicode/lib/unicode/Schema/Unicode.pm
examples/unicode/lib/unicode/View/TT.pm
examples/unicode/lib/unicode/View/TT/Alloy.pm
examples/unicode/root/favicon.ico
examples/unicode/root/formfu/block
examples/unicode/root/formfu/checkboxgroup
examples/unicode/root/formfu/checkboxgroup_tag
examples/unicode/root/formfu/content_button
examples/unicode/root/formfu/end_block
examples/unicode/root/formfu/end_form
examples/unicode/root/formfu/field
examples/unicode/root/formfu/form
examples/unicode/root/formfu/input
examples/unicode/root/formfu/input_tag
examples/unicode/root/formfu/label
examples/unicode/root/formfu/multi
examples/unicode/root/formfu/non_block
examples/unicode/root/formfu/recaptcha
examples/unicode/root/formfu/repeatable
examples/unicode/root/formfu/select_tag
examples/unicode/root/formfu/start_block
examples/unicode/root/formfu/start_form
examples/unicode/root/formfu/textarea_tag
examples/unicode/root/forms/index.yml
examples/unicode/root/forms/view.conf
examples/unicode/root/forms/view.yml
examples/unicode/root/index.tt
examples/unicode/root/static/images/btn_120x50_built.png
examples/unicode/root/static/images/btn_120x50_built_shadow.png
examples/unicode/root/static/images/btn_120x50_powered.png
examples/unicode/root/static/images/btn_120x50_powered_shadow.png
examples/unicode/root/static/images/btn_88x31_built.png
examples/unicode/root/static/images/btn_88x31_built_shadow.png
examples/unicode/root/static/images/btn_88x31_powered.png
examples/unicode/root/static/images/btn_88x31_powered_shadow.png
examples/unicode/root/static/images/catalyst_logo.png
examples/unicode/root/vertically-aligned.css
examples/unicode/root/view.tt
examples/unicode/script/unicode_cgi.pl
examples/unicode/script/unicode_create.pl
examples/unicode/script/unicode_fastcgi.pl
examples/unicode/script/unicode_server.pl
examples/unicode/script/unicode_test.pl
examples/unicode/t/01app.t
examples/unicode/t/02pod.t
examples/unicode/t/03podcoverage.t
examples/unicode/t/model_DB.t
examples/unicode/t/view_TT-Alloy.t
examples/unicode/t/view_TT.t
examples/unicode/unicode.db
examples/unicode/unicode.yml
examples/vertically-aligned-css/test.jpg
examples/vertically-aligned-css/vertically-aligned-ie.css
examples/vertically-aligned-css/vertically-aligned.css
examples/vertically-aligned-css/vertically-aligned.html
examples/vertically-aligned-css/vertically-aligned.pl
examples/vertically-aligned-css/vertically-aligned.tt
examples/vertically-aligned-css/vertically-aligned.yml
lib/HTML/FormFu.pm
lib/HTML/FormFu/Attribute.pm
lib/HTML/FormFu/Constants.pm
lib/HTML/FormFu/Constraint.pm
lib/HTML/FormFu/Constraint/ASCII.pm
lib/HTML/FormFu/Constraint/AllOrNone.pm
lib/HTML/FormFu/Constraint/AutoSet.pm
lib/HTML/FormFu/Constraint/Bool.pm
lib/HTML/FormFu/Constraint/Callback.pm
lib/HTML/FormFu/Constraint/CallbackOnce.pm
lib/HTML/FormFu/Constraint/DateTime.pm
lib/HTML/FormFu/Constraint/DependOn.pm
lib/HTML/FormFu/Constraint/Email.pm
lib/HTML/FormFu/Constraint/Equal.pm
lib/HTML/FormFu/Constraint/File.pm
lib/HTML/FormFu/Constraint/File/MIME.pm
lib/HTML/FormFu/Constraint/File/MaxSize.pm
lib/HTML/FormFu/Constraint/File/MinSize.pm
lib/HTML/FormFu/Constraint/File/Size.pm
lib/HTML/FormFu/Constraint/Integer.pm
lib/HTML/FormFu/Constraint/Length.pm
lib/HTML/FormFu/Constraint/MaxLength.pm
lib/HTML/FormFu/Constraint/MaxRange.pm
lib/HTML/FormFu/Constraint/MinLength.pm
lib/HTML/FormFu/Constraint/MinMaxFields.pm
lib/HTML/FormFu/Constraint/MinRange.pm
lib/HTML/FormFu/Constraint/Number.pm
lib/HTML/FormFu/Constraint/Printable.pm
lib/HTML/FormFu/Constraint/Range.pm
lib/HTML/FormFu/Constraint/Regex.pm
lib/HTML/FormFu/Constraint/Repeatable/Any.pm
lib/HTML/FormFu/Constraint/Required.pm
lib/HTML/FormFu/Constraint/Set.pm
lib/HTML/FormFu/Constraint/SingleValue.pm
lib/HTML/FormFu/Constraint/Word.pm
lib/HTML/FormFu/Deflator.pm
lib/HTML/FormFu/Deflator/Callback.pm
lib/HTML/FormFu/Deflator/CompoundDateTime.pm
lib/HTML/FormFu/Deflator/CompoundSplit.pm
lib/HTML/FormFu/Deflator/FormatNumber.pm
lib/HTML/FormFu/Deflator/PathClassFile.pm
lib/HTML/FormFu/Deflator/Strftime.pm
lib/HTML/FormFu/Deploy.pm
lib/HTML/FormFu/Element.pm
lib/HTML/FormFu/Element/Blank.pm
lib/HTML/FormFu/Element/Block.pm
lib/HTML/FormFu/Element/Button.pm
lib/HTML/FormFu/Element/Checkbox.pm
lib/HTML/FormFu/Element/Checkboxgroup.pm
lib/HTML/FormFu/Element/ComboBox.pm
lib/HTML/FormFu/Element/ContentButton.pm
lib/HTML/FormFu/Element/Date.pm
lib/HTML/FormFu/Element/DateTime.pm
lib/HTML/FormFu/Element/Email.pm
lib/HTML/FormFu/Element/Fieldset.pm
lib/HTML/FormFu/Element/File.pm
lib/HTML/FormFu/Element/Hidden.pm
lib/HTML/FormFu/Element/Hr.pm
lib/HTML/FormFu/Element/Image.pm
lib/HTML/FormFu/Element/Label.pm
lib/HTML/FormFu/Element/Multi.pm
lib/HTML/FormFu/Element/Number.pm
lib/HTML/FormFu/Element/Password.pm
lib/HTML/FormFu/Element/Radio.pm
lib/HTML/FormFu/Element/Radiogroup.pm
lib/HTML/FormFu/Element/Repeatable.pm
lib/HTML/FormFu/Element/Reset.pm
lib/HTML/FormFu/Element/Select.pm
lib/HTML/FormFu/Element/SimpleTable.pm
lib/HTML/FormFu/Element/Src.pm
lib/HTML/FormFu/Element/Submit.pm
lib/HTML/FormFu/Element/Text.pm
lib/HTML/FormFu/Element/Textarea.pm
lib/HTML/FormFu/Element/URL.pm
lib/HTML/FormFu/Exception.pm
lib/HTML/FormFu/Exception/Constraint.pm
lib/HTML/FormFu/Exception/Inflator.pm
lib/HTML/FormFu/Exception/Input.pm
lib/HTML/FormFu/Exception/Transformer.pm
lib/HTML/FormFu/Exception/Validator.pm
lib/HTML/FormFu/FakeQuery.pm
lib/HTML/FormFu/Filter.pm
lib/HTML/FormFu/Filter/Callback.pm
lib/HTML/FormFu/Filter/CompoundJoin.pm
lib/HTML/FormFu/Filter/CompoundSprintf.pm
lib/HTML/FormFu/Filter/CopyValue.pm
lib/HTML/FormFu/Filter/Encode.pm
lib/HTML/FormFu/Filter/ForceListValue.pm
lib/HTML/FormFu/Filter/FormatNumber.pm
lib/HTML/FormFu/Filter/HTMLEscape.pm
lib/HTML/FormFu/Filter/HTMLScrubber.pm
lib/HTML/FormFu/Filter/LowerCase.pm
lib/HTML/FormFu/Filter/NonNumeric.pm
lib/HTML/FormFu/Filter/Regex.pm
lib/HTML/FormFu/Filter/Split.pm
lib/HTML/FormFu/Filter/TrimEdges.pm
lib/HTML/FormFu/Filter/UpperCase.pm
lib/HTML/FormFu/Filter/Whitespace.pm
lib/HTML/FormFu/I18N.pm
lib/HTML/FormFu/I18N/bg.pm
lib/HTML/FormFu/I18N/cs.pm
lib/HTML/FormFu/I18N/da.pm
lib/HTML/FormFu/I18N/de.pm
lib/HTML/FormFu/I18N/en.pm
lib/HTML/FormFu/I18N/es.pm
lib/HTML/FormFu/I18N/fr.pm
lib/HTML/FormFu/I18N/hu.pm
lib/HTML/FormFu/I18N/it.pm
lib/HTML/FormFu/I18N/ja.pm
lib/HTML/FormFu/I18N/no.pm
lib/HTML/FormFu/I18N/pt_br.pm
lib/HTML/FormFu/I18N/pt_pt.pm
lib/HTML/FormFu/I18N/ro.pm
lib/HTML/FormFu/I18N/ru.pm
lib/HTML/FormFu/I18N/ua.pm
lib/HTML/FormFu/I18N/zh_cn.pm
lib/HTML/FormFu/Inflator.pm
lib/HTML/FormFu/Inflator/Callback.pm
lib/HTML/FormFu/Inflator/CompoundDateTime.pm
lib/HTML/FormFu/Inflator/DateTime.pm
lib/HTML/FormFu/Literal.pm
lib/HTML/FormFu/Localize.pm
lib/HTML/FormFu/Manual/Cookbook.pod
lib/HTML/FormFu/Manual/Unicode.pod
lib/HTML/FormFu/Model.pm
lib/HTML/FormFu/Model/HashRef.pm
lib/HTML/FormFu/ObjectUtil.pm
lib/HTML/FormFu/OutputProcessor.pm
lib/HTML/FormFu/OutputProcessor/Indent.pm
lib/HTML/FormFu/OutputProcessor/StripWhitespace.pm
lib/HTML/FormFu/Plugin.pm
lib/HTML/FormFu/Plugin/StashValid.pm
lib/HTML/FormFu/Preload.pm
lib/HTML/FormFu/Processor.pm
lib/HTML/FormFu/QueryType/CGI.pm
lib/HTML/FormFu/QueryType/CGI/Simple.pm
lib/HTML/FormFu/QueryType/Catalyst.pm
lib/HTML/FormFu/Role/Constraint/Others.pm
lib/HTML/FormFu/Role/ContainsElements.pm
lib/HTML/FormFu/Role/ContainsElementsSharedWithField.pm
lib/HTML/FormFu/Role/CreateChildren.pm
lib/HTML/FormFu/Role/CustomRoles.pm
lib/HTML/FormFu/Role/Element/Coercible.pm
lib/HTML/FormFu/Role/Element/Field.pm
lib/HTML/FormFu/Role/Element/FieldMethods.pm
lib/HTML/FormFu/Role/Element/Group.pm
lib/HTML/FormFu/Role/Element/Input.pm
lib/HTML/FormFu/Role/Element/Layout.pm
lib/HTML/FormFu/Role/Element/MultiElement.pm
lib/HTML/FormFu/Role/Element/NonBlock.pm
lib/HTML/FormFu/Role/Element/ProcessOptionsFromModel.pm
lib/HTML/FormFu/Role/Element/SingleValueField.pm
lib/HTML/FormFu/Role/Filter/Compound.pm
lib/HTML/FormFu/Role/FormAndBlockMethods.pm
lib/HTML/FormFu/Role/FormAndElementMethods.pm
lib/HTML/FormFu/Role/FormBlockAndFieldMethods.pm
lib/HTML/FormFu/Role/GetProcessors.pm
lib/HTML/FormFu/Role/HasParent.pm
lib/HTML/FormFu/Role/NestedHashUtils.pm
lib/HTML/FormFu/Role/Populate.pm
lib/HTML/FormFu/Role/Render.pm
lib/HTML/FormFu/Transformer.pm
lib/HTML/FormFu/Transformer/Callback.pm
lib/HTML/FormFu/Upload.pm
lib/HTML/FormFu/UploadParam.pm
lib/HTML/FormFu/Util.pm
lib/HTML/FormFu/Validator.pm
lib/HTML/FormFu/Validator/Callback.pm
lib/MooseX/Attribute/FormFuChained.pm
lib/MooseX/FormFuChainedAccessors.pm
lib/MooseX/Traits/Attribute/FormFuChained.pm
share/templates/tt/xhtml/block
share/templates/tt/xhtml/end_block
share/templates/tt/xhtml/end_form
share/templates/tt/xhtml/field
share/templates/tt/xhtml/field_layout
share/templates/tt/xhtml/field_layout_block
share/templates/tt/xhtml/field_layout_checkboxgroup_field
share/templates/tt/xhtml/field_layout_comment
share/templates/tt/xhtml/field_layout_contentbutton_field
share/templates/tt/xhtml/field_layout_errors
share/templates/tt/xhtml/field_layout_field
share/templates/tt/xhtml/field_layout_javascript
share/templates/tt/xhtml/field_layout_label
share/templates/tt/xhtml/field_layout_label_field
share/templates/tt/xhtml/field_layout_label_text
share/templates/tt/xhtml/field_layout_multi_field
share/templates/tt/xhtml/field_layout_parser
share/templates/tt/xhtml/field_layout_select_field
share/templates/tt/xhtml/field_layout_textarea_field
share/templates/tt/xhtml/form
share/templates/tt/xhtml/non_block
share/templates/tt/xhtml/recaptcha
share/templates/tt/xhtml/repeatable
share/templates/tt/xhtml/start_block
share/templates/tt/xhtml/start_form
t-aggregate/01use.t
t-aggregate/04basic.t
t-aggregate/04basic.yml
t-aggregate/05_repeated_render.t
t-aggregate/block_insert_after.t
t-aggregate/block_insert_before.t
t-aggregate/bugs/constructor_arg_overwrites_default.t
t-aggregate/bugs/date_element_deflator.t
t-aggregate/bugs/date_element_empty_input.t
t-aggregate/bugs/datetime_hour_lt_10.t
t-aggregate/bugs/disabled_select_default_value.yml
t-aggregate/bugs/element_class.t
t-aggregate/bugs/element_parent.t
t-aggregate/bugs/empty_block_with_nested_name.t
t-aggregate/bugs/empty_block_with_nested_name.yml
t-aggregate/bugs/error_msg.t
t-aggregate/bugs/error_multiple_fields_same_name.t
t-aggregate/bugs/error_multiple_fields_same_name.yml
t-aggregate/bugs/field_no_name.t
t-aggregate/bugs/filter_run_once.t
t-aggregate/bugs/multiple_checkbox_same_name.t
t-aggregate/bugs/multiple_checkbox_same_name.yml
t-aggregate/bugs/name_regex_chars.t
t-aggregate/bugs/not_nested.t
t-aggregate/bugs/populate_element_coderef.t
t-aggregate/bugs/pre_1_00_compat.t
t-aggregate/bugs/pre_1_00_compat.yml
t-aggregate/bugs/render_processed_value_retain_default.t
t-aggregate/bugs/render_processed_value_retain_default.yml
t-aggregate/bugs/repeatable_increase_rep.t
t-aggregate/bugs/repeatable_increase_rep.yml
t-aggregate/bugs/result_params_multiple.t
t-aggregate/bugs/select_empty_options.t
t-aggregate/bugs/submit_no_value.t
t-aggregate/bugs/submit_retain_default.t
t-aggregate/bugs/value_empty_string.t
t-aggregate/bugs/value_no_default.t
t-aggregate/bugs/yaml_utf8.t
t-aggregate/bugs/yaml_utf8.txt
t-aggregate/bugs/yaml_utf8.yml
t-aggregate/constraints/allornone.t
t-aggregate/constraints/allornone_attach_errors_to_base.t
t-aggregate/constraints/allornone_attach_errors_to_base.yml
t-aggregate/constraints/allornone_attach_errors_to_others.t
t-aggregate/constraints/allornone_attach_errors_to_others.yml
t-aggregate/constraints/ascii.t
t-aggregate/constraints/autoset.t
t-aggregate/constraints/autoset_group.t
t-aggregate/constraints/bool.t
t-aggregate/constraints/callback.t
t-aggregate/constraints/callbackonce.t
t-aggregate/constraints/constraint.t
t-aggregate/constraints/constraint_other_siblings.t
t-aggregate/constraints/constraint_other_siblings.yml
t-aggregate/constraints/constraint_other_siblings_not.t
t-aggregate/constraints/constraint_other_siblings_not.yml
t-aggregate/constraints/constraint_when.t
t-aggregate/constraints/constraint_when.yml
t-aggregate/constraints/constraint_when_any_field.t
t-aggregate/constraints/constraint_when_any_field.yml
t-aggregate/constraints/constraint_when_any_true_value.t
t-aggregate/constraints/constraint_when_any_true_value.yml
t-aggregate/constraints/constraint_when_default_empty_value.t
t-aggregate/constraints/constraint_when_default_empty_value.yml
t-aggregate/constraints/constraint_when_fields.t
t-aggregate/constraints/constraint_when_fields.yml
t-aggregate/constraints/datetime_parser.t
t-aggregate/constraints/dependon.t
t-aggregate/constraints/dependon_attach_errors_to_base.t
t-aggregate/constraints/dependon_attach_errors_to_base.yml
t-aggregate/constraints/dependon_attach_errors_to_others.t
t-aggregate/constraints/dependon_attach_errors_to_others.yml
t-aggregate/constraints/email.t
t-aggregate/constraints/equal.t
t-aggregate/constraints/equal_internals.t
t-aggregate/constraints/equal_not.t
t-aggregate/constraints/file.t
t-aggregate/constraints/file.yml
t-aggregate/constraints/file_maxsize.t
t-aggregate/constraints/file_maxsize.yml
t-aggregate/constraints/file_mime.t
t-aggregate/constraints/file_mime.yml
t-aggregate/constraints/file_minsize.t
t-aggregate/constraints/file_minsize.yml
t-aggregate/constraints/file_size.t
t-aggregate/constraints/file_size.yml
t-aggregate/constraints/integer.t
t-aggregate/constraints/length.t
t-aggregate/constraints/localize.t
t-aggregate/constraints/maxlength.t
t-aggregate/constraints/maxrange.t
t-aggregate/constraints/minlength.t
t-aggregate/constraints/minmaxfields.t
t-aggregate/constraints/minmaxfields_with_filter_split.t
t-aggregate/constraints/minmaxfields_with_filter_split.yml
t-aggregate/constraints/minrange.t
t-aggregate/constraints/not_equal.t
t-aggregate/constraints/not_word.t
t-aggregate/constraints/number.t
t-aggregate/constraints/printable.t
t-aggregate/constraints/range.t
t-aggregate/constraints/regex.t
t-aggregate/constraints/regex_anchored.t
t-aggregate/constraints/regex_common.t
t-aggregate/constraints/repeatable_any.t
t-aggregate/constraints/repeatable_any.yml
t-aggregate/constraints/repeatable_any_not_increment_field_names.t
t-aggregate/constraints/repeatable_any_not_increment_field_names.yml
t-aggregate/constraints/required.t
t-aggregate/constraints/required_file.t
t-aggregate/constraints/required_file.yml
t-aggregate/constraints/required_only_on_reps.t
t-aggregate/constraints/required_only_on_reps.yml
t-aggregate/constraints/set.t
t-aggregate/constraints/singlevalue.t
t-aggregate/constraints/word.t
t-aggregate/constraints/xml.t
t-aggregate/deflators/callback.t
t-aggregate/deflators/compounddatetime.t
t-aggregate/deflators/compounddatetime.yml
t-aggregate/deflators/compounddatetime_field_order.t
t-aggregate/deflators/compounddatetime_field_order.yml
t-aggregate/deflators/compoundsplit.t
t-aggregate/deflators/compoundsplit.yml
t-aggregate/deflators/compoundsplit_after_submit.t
t-aggregate/deflators/compoundsplit_after_submit.yml
t-aggregate/deflators/compoundsplit_field_order.t
t-aggregate/deflators/compoundsplit_field_order.yml
t-aggregate/deflators/compoundsplit_split.t
t-aggregate/deflators/compoundsplit_split.yml
t-aggregate/deflators/formatnumber.t
t-aggregate/deflators/formatnumber.yml
t-aggregate/deflators/pathclassfile.t
t-aggregate/elements/blank.t
t-aggregate/elements/block.t
t-aggregate/elements/block_auto_block_id.t
t-aggregate/elements/block_auto_block_id.yml
t-aggregate/elements/block_repeatable.t
t-aggregate/elements/block_repeatable.yml
t-aggregate/elements/block_repeatable_attrs.t
t-aggregate/elements/block_repeatable_attrs.yml
t-aggregate/elements/block_repeatable_auto_block_id.t
t-aggregate/elements/block_repeatable_auto_block_id.yml
t-aggregate/elements/block_repeatable_auto_id.t
t-aggregate/elements/block_repeatable_auto_id.yml
t-aggregate/elements/block_repeatable_date.t
t-aggregate/elements/block_repeatable_date.yml
t-aggregate/elements/block_repeatable_inc.t
t-aggregate/elements/block_repeatable_inc.yml
t-aggregate/elements/block_repeatable_multi.t
t-aggregate/elements/block_repeatable_tag.t
t-aggregate/elements/block_repeatable_tag.yml
t-aggregate/elements/button.t
t-aggregate/elements/button_no_name.t
t-aggregate/elements/checkbox.t
t-aggregate/elements/checkbox_force_default.t
t-aggregate/elements/checkbox_retain_default.t
t-aggregate/elements/checkbox_reverse.t
t-aggregate/elements/checkbox_reverse.yml
t-aggregate/elements/checkboxgroup.t
t-aggregate/elements/checkboxgroup_attributes_escaped.t
t-aggregate/elements/checkboxgroup_attributes_escaped.yml
t-aggregate/elements/combobox.t
t-aggregate/elements/combobox.yml
t-aggregate/elements/combobox_repeatable.t
t-aggregate/elements/combobox_repeatable.yml
t-aggregate/elements/combobox_required.t
t-aggregate/elements/combobox_required.yml
t-aggregate/elements/content_button.t
t-aggregate/elements/date.t
t-aggregate/elements/date_default.t
t-aggregate/elements/date_default_datetime_args.t
t-aggregate/elements/date_default_datetime_args.yml
t-aggregate/elements/date_default_empty.t
t-aggregate/elements/date_month_year.t
t-aggregate/elements/date_natural.t
t-aggregate/elements/date_order.t
t-aggregate/elements/date_order_error.t
t-aggregate/elements/date_rename.t
t-aggregate/elements/date_undef.t
t-aggregate/elements/date_year_reverse.t
t-aggregate/elements/date_year_reverse.yml
t-aggregate/elements/datetime.t
t-aggregate/elements/datetime.yml
t-aggregate/elements/datetime_interval.t
t-aggregate/elements/datetime_interval.yml
t-aggregate/elements/datetime_seconds.t
t-aggregate/elements/datetime_seconds.yml
t-aggregate/elements/element_setup.t
t-aggregate/elements/email.t
t-aggregate/elements/escaping.t
t-aggregate/elements/field_default_empty_value.t
t-aggregate/elements/field_non_param.t
t-aggregate/elements/fieldset.t
t-aggregate/elements/fieldset_legend_attrs.t
t-aggregate/elements/fieldset_legend_attrs.yml
t-aggregate/elements/file.t
t-aggregate/elements/file_post.txt
t-aggregate/elements/file_post_cgi_simple.t
t-aggregate/elements/hidden.t
t-aggregate/elements/hr.t
t-aggregate/elements/image.t
t-aggregate/elements/label.t
t-aggregate/elements/label.yml
t-aggregate/elements/label_value_submission.t
t-aggregate/elements/label_value_submission.yml
t-aggregate/elements/multi.t
t-aggregate/elements/multi_errors.t
t-aggregate/elements/multiple_submit_buttons.t
t-aggregate/elements/no_block_tag.t
t-aggregate/elements/no_block_tag.yml
t-aggregate/elements/no_container_tag.t
t-aggregate/elements/no_container_tag.yml
t-aggregate/elements/number.t
t-aggregate/elements/number.yml
t-aggregate/elements/object.t
t-aggregate/elements/object/field_layout_field_custom
t-aggregate/elements/password.t
t-aggregate/elements/password_render_value.t
t-aggregate/elements/password_retain_default.t
t-aggregate/elements/radio.t
t-aggregate/elements/radio_force_default.t
t-aggregate/elements/radio_retain_default.t
t-aggregate/elements/radiogroup.t
t-aggregate/elements/radiogroup_attributes_escaped.t
t-aggregate/elements/radiogroup_attributes_escaped.yml
t-aggregate/elements/radiogroup_attrs_xml.t
t-aggregate/elements/radiogroup_dup_opt.t
t-aggregate/elements/radiogroup_errors.t
t-aggregate/elements/radiogroup_force_default.t
t-aggregate/elements/radiogroup_id.t
t-aggregate/elements/radiogroup_id_value.t
t-aggregate/elements/radiogroup_retain_default.t
t-aggregate/elements/radiogroup_subgroup.t
t-aggregate/elements/radiogroup_unknown_opt.t
t-aggregate/elements/radiogroup_xml.t
t-aggregate/elements/render_method.t
t-aggregate/elements/repeatable_counter_name.t
t-aggregate/elements/repeatable_counter_name.yml
t-aggregate/elements/repeatable_repeatable.t
t-aggregate/elements/repeatable_repeatable.yml
t-aggregate/elements/reset.t
t-aggregate/elements/reverse.t
t-aggregate/elements/select.t
t-aggregate/elements/select_attributes_escaped.t
t-aggregate/elements/select_attributes_escaped.yml
t-aggregate/elements/select_deflator_default.t
t-aggregate/elements/select_empty_first.t
t-aggregate/elements/select_empty_first.yml
t-aggregate/elements/select_empty_first_label.t
t-aggregate/elements/select_force_default.t
t-aggregate/elements/select_label_loc.t
t-aggregate/elements/select_multi_default_values.t
t-aggregate/elements/select_multi_value.t
t-aggregate/elements/select_optgroup.t
t-aggregate/elements/select_options.t
t-aggregate/elements/select_retain_default.t
t-aggregate/elements/select_same_name.t
t-aggregate/elements/select_same_name.yml
t-aggregate/elements/select_value_range.t
t-aggregate/elements/simple_table.t
t-aggregate/elements/simple_table.yml
t-aggregate/elements/simple_table_class.t
t-aggregate/elements/simple_table_class.yml
t-aggregate/elements/simple_table_multiple.t
t-aggregate/elements/simple_table_multiple.yml
t-aggregate/elements/src.t
t-aggregate/elements/submit.t
t-aggregate/elements/text.t
t-aggregate/elements/text_attributes.t
t-aggregate/elements/text_auto_comment_class.t
t-aggregate/elements/text_auto_comment_class.yml
t-aggregate/elements/text_auto_container_class.t
t-aggregate/elements/text_auto_container_class.yml
t-aggregate/elements/text_auto_container_comment_class.t
t-aggregate/elements/text_auto_container_comment_class.yml
t-aggregate/elements/text_auto_container_error_class.t
t-aggregate/elements/text_auto_container_error_class.yml
t-aggregate/elements/text_auto_container_label_class.t
t-aggregate/elements/text_auto_container_label_class.yml
t-aggregate/elements/text_auto_label_class.t
t-aggregate/elements/text_auto_label_class.yml
t-aggregate/elements/text_datalist_options.t
t-aggregate/elements/text_datalist_options.yml
t-aggregate/elements/text_datalist_values.t
t-aggregate/elements/text_datalist_values.yml
t-aggregate/elements/text_errors.t
t-aggregate/elements/text_force_default.t
t-aggregate/elements/text_layout.t
t-aggregate/elements/text_layout.yml
t-aggregate/elements/text_retain_default.t
t-aggregate/elements/text_title.t
t-aggregate/elements/textarea.t
t-aggregate/elements/url.t
t-aggregate/elements/url.yml
t-aggregate/examples/custom_label.t
t-aggregate/examples/custom_label2.t
t-aggregate/examples/field_as.t
t-aggregate/examples/fields_as_list_items.t
t-aggregate/field_accessor_loc.t
t-aggregate/field_accessor_loc_arrayref.t
t-aggregate/field_accessor_loc_arrayref.yml
t-aggregate/field_change_name.t
t-aggregate/field_id.t
t-aggregate/filters/all_by_default.t
t-aggregate/filters/callback.t
t-aggregate/filters/compoundjoin.t
t-aggregate/filters/compoundjoin.yml
t-aggregate/filters/compoundjoin_field_order.t
t-aggregate/filters/compoundjoin_field_order.yml
t-aggregate/filters/compoundjoin_join.t
t-aggregate/filters/compoundjoin_join.yml
t-aggregate/filters/compoundsprintf.t
t-aggregate/filters/compoundsprintf.yml
t-aggregate/filters/compoundsprintf_field_order.t
t-aggregate/filters/compoundsprintf_field_order.yml
t-aggregate/filters/copyvalue.t
t-aggregate/filters/encode.t
t-aggregate/filters/filter.t
t-aggregate/filters/formatnumber.t
t-aggregate/filters/formatnumber.yml
t-aggregate/filters/htmlescape.t
t-aggregate/filters/htmlscrubber.t
t-aggregate/filters/lowercase.t
t-aggregate/filters/nonnumeric.t
t-aggregate/filters/regex.t
t-aggregate/filters/regex.yml
t-aggregate/filters/regex_eval.t
t-aggregate/filters/regex_eval.yml
t-aggregate/filters/split.t
t-aggregate/filters/split.yml
t-aggregate/filters/trimedges.t
t-aggregate/filters/uppercase.t
t-aggregate/filters/whitespace.t
t-aggregate/force_errors/allornone.t
t-aggregate/force_errors/callbackonce.t
t-aggregate/force_errors/dependon.t
t-aggregate/force_errors/equal.t
t-aggregate/force_errors/force_errors.t
t-aggregate/force_errors/integer.t
t-aggregate/force_errors/minmaxfields.t
t-aggregate/form/add_render_class_args.t
t-aggregate/form/add_valid.t
t-aggregate/form/add_valid_unknown.t
t-aggregate/form/attributes.t
t-aggregate/form/auto_constraint_class.t
t-aggregate/form/auto_error_class.t
t-aggregate/form/auto_error_message.t
t-aggregate/form/auto_fieldset.t
t-aggregate/form/auto_label.t
t-aggregate/form/clone.t
t-aggregate/form/config_callback.t
t-aggregate/form/config_callback.yml
t-aggregate/form/constraints_from_dbic.t
t-aggregate/form/constraints_from_dbic_rs.t
t-aggregate/form/default_args.t
t-aggregate/form/default_args_alt.t
t-aggregate/form/default_args_alt.yml
t-aggregate/form/default_args_isa.t
t-aggregate/form/default_args_isa.yml
t-aggregate/form/default_args_not_inheriting.t
t-aggregate/form/default_values.t
t-aggregate/form/end.t
t-aggregate/form/error_message.t
t-aggregate/form/force_error_message.t
t-aggregate/form/form_error_message_class.t
t-aggregate/form/get_all_elements.t
t-aggregate/form/get_constraint.t
t-aggregate/form/get_constraints.t
t-aggregate/form/get_deflator.t
t-aggregate/form/get_deflators.t
t-aggregate/form/get_element.t
t-aggregate/form/get_elements.t
t-aggregate/form/get_errors.t
t-aggregate/form/get_field.t
t-aggregate/form/get_fields.t
t-aggregate/form/get_filter.t
t-aggregate/form/get_filters.t
t-aggregate/form/get_inflator.t
t-aggregate/form/get_inflators.t
t-aggregate/form/get_parent.t
t-aggregate/form/get_parent.yml
t-aggregate/form/has_errors.t
t-aggregate/form/hidden_fields.t
t-aggregate/form/init_arg.t
t-aggregate/form/insert_after.t
t-aggregate/form/insert_before.t
t-aggregate/form/javascript.t
t-aggregate/form/javascript_src.t
t-aggregate/form/languages.t
t-aggregate/form/languages.yml
t-aggregate/form/model.t
t-aggregate/form/multiple_same_named_fields.t
t-aggregate/form/object.t
t-aggregate/form/object/form
t-aggregate/form/param.t
t-aggregate/form/param_array.t
t-aggregate/form/param_list.t
t-aggregate/form/param_value.t
t-aggregate/form/params.t
t-aggregate/form/params_ignore_underscore.t
t-aggregate/form/query.t
t-aggregate/form/render_processed_value.t
t-aggregate/form/render_processed_value.yml
t-aggregate/form/start.t
t-aggregate/form/stash.t
t-aggregate/form/submitted.t
t-aggregate/form/submitted_and_valid.t
t-aggregate/form/title_xml.t
t-aggregate/form/valid.t
t-aggregate/i18n/add_localize_object.t
t-aggregate/i18n/add_localize_object_from_class.t
t-aggregate/i18n/add_localize_object_from_class.yml
t-aggregate/inflators/array.t
t-aggregate/inflators/callback.t
t-aggregate/inflators/compounddatetime.t
t-aggregate/inflators/compounddatetime.yml
t-aggregate/inflators/compounddatetime_field_order.t
t-aggregate/inflators/compounddatetime_field_order.yml
t-aggregate/inflators/datetime_optional.t
t-aggregate/inflators/datetime_parser.t
t-aggregate/inflators/datetime_regex.t
t-aggregate/inflators/datetime_regex_string.t
t-aggregate/inflators/datetime_strptime.t
t-aggregate/inflators/datetime_timezone.t
t-aggregate/inflators/datetime_with_constraint.t
t-aggregate/inflators/datetime_with_constraint.yml
t-aggregate/internals/default_args-types.t
t-aggregate/internals/default_args-types.yml
t-aggregate/load_config/config_file_path.t
t-aggregate/load_config/config_file_path/form.yml
t-aggregate/load_config/config_file_path2/form.yml
t-aggregate/load_config/load_config_file.t
t-aggregate/load_config/load_config_file_constraint_regex.t
t-aggregate/load_config/load_config_file_constraint_regex.yml
t-aggregate/load_config/load_config_file_fieldset.yml
t-aggregate/load_config/load_config_file_form.yml
t-aggregate/load_config/load_config_file_multi_stream.t
t-aggregate/load_config/load_config_file_multi_stream.yml
t-aggregate/load_config/load_config_file_multiple.t
t-aggregate/load_config/load_config_file_multiple.yml
t-aggregate/load_config/load_config_file_multiple1.yml
t-aggregate/load_config/load_config_file_multiple2.yml
t-aggregate/load_config/load_config_filestem.t
t-aggregate/model/hashref_create.t
t-aggregate/model/hashref_create_repeatable_without_nestedname.t
t-aggregate/model/hashref_create_repeatable_without_nestedname.yml
t-aggregate/model/hashref_default_values.t
t-aggregate/model/hashref_escaping.t
t-aggregate/model/hashref_multi_within_rep.t
t-aggregate/model/hashref_multi_within_rep.yml
t-aggregate/model/hashref_process.t
t-aggregate/multiple_select_fields.t
t-aggregate/multiple_text_fields.t
t-aggregate/nested/constraints/allornone.t
t-aggregate/nested/constraints/callbackonce.t
t-aggregate/nested/constraints/constraint_when.t
t-aggregate/nested/constraints/constraint_when.yml
t-aggregate/nested/constraints/dependon.t
t-aggregate/nested/constraints/equal.t
t-aggregate/nested/constraints/minmaxfields.t
t-aggregate/nested/constraints/required.t
t-aggregate/nested/element_name.t
t-aggregate/nested/element_name.yml
t-aggregate/nested/elements/block_repeatable_multi_named.t
t-aggregate/nested/elements/block_repeatable_multi_named.yml
t-aggregate/nested/elements/block_repeatable_multi_named_filter.t
t-aggregate/nested/elements/block_repeatable_multi_named_filter.yml
t-aggregate/nested/elements/block_without_name.t
t-aggregate/nested/elements/block_without_name.yml
t-aggregate/nested/elements/checkbox_force_default.t
t-aggregate/nested/elements/checkbox_retain_default.t
t-aggregate/nested/elements/combobox.t
t-aggregate/nested/elements/date.t
t-aggregate/nested/elements/multi.t
t-aggregate/nested/elements/multi_named.t
t-aggregate/nested/elements/radio.t
t-aggregate/nested/elements/radio_force_default.t
t-aggregate/nested/elements/radio_retain_default.t
t-aggregate/nested/elements/radiogroup.t
t-aggregate/nested/elements/radiogroup_force_default.t
t-aggregate/nested/elements/radiogroup_retain_default.t
t-aggregate/nested/elements/repeatable_repeatable.t
t-aggregate/nested/elements/repeatable_repeatable.yml
t-aggregate/nested/elements/select.t
t-aggregate/nested/elements/select_force_default.t
t-aggregate/nested/elements/select_retain_default.t
t-aggregate/nested/elements/select_same_name.t
t-aggregate/nested/elements/select_same_name.yml
t-aggregate/nested/elements/text.t
t-aggregate/nested/filters/regex.t
t-aggregate/nested/form/render_processed_value.t
t-aggregate/nested/form/render_processed_value.yml
t-aggregate/nested/form_input.t
t-aggregate/nested/illegal_name.t
t-aggregate/nested/inflators/datetime_strptime.t
t-aggregate/nested/internals/form_processed_params.t
t-aggregate/nested/internals/hash_keys.t
t-aggregate/nested/param.t
t-aggregate/nested/params.t
t-aggregate/nested/pre_expanded.t
t-aggregate/nested/transformers/callback.t
t-aggregate/nested/valid.t
t-aggregate/nested/validators/callback.t
t-aggregate/output_processors/indent.t
t-aggregate/output_processors/indent_internals.t
t-aggregate/output_processors/strip_whitespace.t
t-aggregate/output_processors/strip_whitespace.yml
t-aggregate/plugins/stashvalid.t
t-aggregate/plugins/stashvalid.yml
t-aggregate/plugins/stashvalid_on_field.t
t-aggregate/plugins/stashvalid_on_field.yml
t-aggregate/repeatable/clone.t
t-aggregate/repeatable/clone.yml
t-aggregate/repeatable/constraints/attach_errors_to.t
t-aggregate/repeatable/constraints/attach_errors_to.yml
t-aggregate/repeatable/constraints/equal.t
t-aggregate/repeatable/constraints/equal.yml
t-aggregate/repeatable/constraints/required.t
t-aggregate/repeatable/constraints/required.yml
t-aggregate/repeatable/constraints/required_not_increment_field_names.t
t-aggregate/repeatable/constraints/required_not_increment_field_names.yml
t-aggregate/repeatable/constraints/required_not_nested.t
t-aggregate/repeatable/constraints/required_not_nested.yml
t-aggregate/repeatable/constraints/when.t
t-aggregate/repeatable/constraints/when.yml
t-aggregate/repeatable/repeatable/constraints/repeatable_any.t
t-aggregate/repeatable/repeatable/constraints/repeatable_any.yml
t-aggregate/roles/block.t
t-aggregate/roles/block.yml
t-aggregate/roles/field.t
t-aggregate/roles/field.yml
t-aggregate/roles/form.t
t-aggregate/roles/form.yml
t-aggregate/transformers/callback.t
t-aggregate/utils/append_xml_attribute.t
t-aggregate/utils/has_xml_attribute.t
t-aggregate/utils/remove_xml_attribute.t
t-aggregate/validators/callback.t
t-aggregate/validators/validator.t
t/aggregate.t
t/elements-file_post.t
t/elements-file_post.txt
t/lib/HTMLFormFu/DBICUniqueFake.pm
t/lib/HTMLFormFu/ElementSetup.pm
t/lib/HTMLFormFu/I18N.pm
t/lib/HTMLFormFu/I18N/en.pm
t/lib/HTMLFormFu/MyBlockRole.pm
t/lib/HTMLFormFu/MyDeflator.pm
t/lib/HTMLFormFu/MyFieldRole.pm
t/lib/HTMLFormFu/MyFormRole.pm
t/lib/HTMLFormFu/MyModel.pm
t/lib/HTMLFormFu/MyObject.pm
t/lib/HTMLFormFu/MyValidator.pm
t/lib/HTMLFormFu/RegressLocalization.pm
t/lib/HTMLFormFu/RegressLocalization/en.pm
t/lib/HTMLFormFu/TestLib.pm
t/lib/MyApp/Schema.pm
t/lib/MyApp/Schema/Dongle.pm
t/lib/MyApp/Schema/Person.pm
t/nested-elements-file_post.t
t/templates/field_layout
Makefile.PL 100644 001751 001752 7143 12331714662 14471 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01
# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.015.
use strict;
use warnings;
use 5.008001;
use ExtUtils::MakeMaker 6.30;
use File::ShareDir::Install;
install_share dist => "share";
my %WriteMakefileArgs = (
"ABSTRACT" => "HTML Form Creation, Rendering and Validation Framework",
"AUTHOR" => "Carl Franks ",
"BUILD_REQUIRES" => {},
"CONFIGURE_REQUIRES" => {
"ExtUtils::MakeMaker" => "6.30",
"File::ShareDir::Install" => "0.03"
},
"DISTNAME" => "HTML-FormFu",
"EXE_FILES" => [
"bin/html_formfu_deploy.pl",
"bin/html_formfu_dumpconf.pl"
],
"LICENSE" => "perl",
"NAME" => "HTML::FormFu",
"PREREQ_PM" => {
"Carp" => 0,
"Class::MOP::Method" => 0,
"Clone" => "0.31",
"Config::Any" => "0.18",
"Cwd" => 0,
"Data::Visitor" => "0.26",
"Data::Visitor::Callback" => 0,
"DateTime" => "0.54",
"DateTime::Format::Builder" => "0.7901",
"DateTime::Format::Natural" => 0,
"DateTime::Format::Strptime" => "1.2000",
"DateTime::Locale" => "0.45",
"Email::Valid" => 0,
"Encode" => 0,
"Exporter" => "5.57",
"Fatal" => 0,
"File::Copy" => 0,
"File::Find" => 0,
"File::ShareDir" => 0,
"File::Spec" => 0,
"File::Temp" => 0,
"HTML::Scrubber" => 0,
"HTML::TokeParser::Simple" => "3.14",
"HTTP::Headers" => "1.64",
"Hash::Flatten" => 0,
"IO::File" => 0,
"List::MoreUtils" => 0,
"List::Util" => 0,
"Locale::Maketext" => 0,
"Module::Pluggable" => 0,
"Moose" => "1.00",
"Moose::Role" => 0,
"Moose::Util" => 0,
"MooseX::Aliases" => 0,
"Number::Format" => 0,
"Path::Class::File" => 0,
"Readonly" => 0,
"Regexp::Common" => 0,
"Scalar::Util" => 0,
"Storable" => 0,
"Task::Weaken" => 0,
"YAML::XS" => "0.32"
},
"TEST_REQUIRES" => {
"CGI" => "3.37",
"POSIX" => 0,
"Test::Aggregate::Nested" => "0.371",
"Test::Exception" => 0,
"Test::More" => "0.92"
},
"VERSION" => "2.01",
"test" => {
"TESTS" => "t/*.t"
}
);
my %FallbackPrereqs = (
"CGI" => "3.37",
"Carp" => 0,
"Class::MOP::Method" => 0,
"Clone" => "0.31",
"Config::Any" => "0.18",
"Cwd" => 0,
"Data::Visitor" => "0.26",
"Data::Visitor::Callback" => 0,
"DateTime" => "0.54",
"DateTime::Format::Builder" => "0.7901",
"DateTime::Format::Natural" => 0,
"DateTime::Format::Strptime" => "1.2000",
"DateTime::Locale" => "0.45",
"Email::Valid" => 0,
"Encode" => 0,
"Exporter" => "5.57",
"Fatal" => 0,
"File::Copy" => 0,
"File::Find" => 0,
"File::ShareDir" => 0,
"File::Spec" => 0,
"File::Temp" => 0,
"HTML::Scrubber" => 0,
"HTML::TokeParser::Simple" => "3.14",
"HTTP::Headers" => "1.64",
"Hash::Flatten" => 0,
"IO::File" => 0,
"List::MoreUtils" => 0,
"List::Util" => 0,
"Locale::Maketext" => 0,
"Module::Pluggable" => 0,
"Moose" => "1.00",
"Moose::Role" => 0,
"Moose::Util" => 0,
"MooseX::Aliases" => 0,
"Number::Format" => 0,
"POSIX" => 0,
"Path::Class::File" => 0,
"Readonly" => 0,
"Regexp::Common" => 0,
"Scalar::Util" => 0,
"Storable" => 0,
"Task::Weaken" => 0,
"Test::Aggregate::Nested" => "0.371",
"Test::Exception" => 0,
"Test::More" => "0.92",
"YAML::XS" => "0.32"
);
unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
delete $WriteMakefileArgs{TEST_REQUIRES};
delete $WriteMakefileArgs{BUILD_REQUIRES};
$WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}
delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
unless eval { ExtUtils::MakeMaker->VERSION(6.52) };
WriteMakefile(%WriteMakefileArgs);
{
package
MY;
use File::ShareDir::Install qw(postamble);
}
MANIFEST.SKIP 100644 001751 001752 310 12331714662 14362 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01 # Don't know if it's getting kept
^lib\/HTML\/FormFu\/Filter\/Default\.pm$
# not ready yet
^t-aggregate\/multiform-misc\/file
^benchmarks\b
^examples\/client-side-constraint\b
^xt\/
^\.perltidyrc$
t 000755 001751 001752 0 12331714662 12615 5 ustar 00carl carl 000000 000000 HTML-FormFu-2.01 aggregate.t 100644 001751 001752 256 12331714662 15053 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t use strict;
use warnings;
use Test::More;
use Test::Aggregate::Nested;
Test::Aggregate::Nested->new( {
dirs => 't-aggregate',
# verbose => 1,
} )->run;
HTML 000755 001751 001752 0 12331714662 13664 5 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/lib FormFu.pm 100644 001751 001752 240632 12331714662 15627 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/lib/HTML package HTML::FormFu;
$HTML::FormFu::VERSION = '2.01';
use Moose;
use MooseX::Attribute::FormFuChained;
with 'HTML::FormFu::Role::Render',
'HTML::FormFu::Role::CreateChildren',
'HTML::FormFu::Role::GetProcessors',
'HTML::FormFu::Role::ContainsElements',
'HTML::FormFu::Role::ContainsElementsSharedWithField',
'HTML::FormFu::Role::FormAndBlockMethods',
'HTML::FormFu::Role::FormAndElementMethods',
'HTML::FormFu::Role::FormBlockAndFieldMethods',
'HTML::FormFu::Role::NestedHashUtils',
'HTML::FormFu::Role::Populate',
'HTML::FormFu::Role::CustomRoles';
use HTML::FormFu::Attribute qw(
mk_attrs
mk_attr_accessors
mk_output_accessors
mk_inherited_accessors
mk_inherited_merging_accessors
);
use HTML::FormFu::Constants qw( $EMPTY_STR );
use HTML::FormFu::Constraint;
use HTML::FormFu::Exception;
use HTML::FormFu::FakeQuery;
use HTML::FormFu::Filter;
use HTML::FormFu::Inflator;
use HTML::FormFu::Localize;
use HTML::FormFu::ObjectUtil qw(
form
load_config_file load_config_filestem
clone stash
constraints_from_dbic parent
_load_file
);
use HTML::FormFu::Util qw(
DEBUG
DEBUG_PROCESS
DEBUG_CONSTRAINTS
debug
require_class _get_elements
xml_escape split_name
_parse_args process_attrs
_filter_components
);
use Clone ();
use List::Util qw( first );
use List::MoreUtils qw( any none uniq );
use Scalar::Util qw( blessed refaddr weaken reftype );
use Carp qw( croak );
use overload (
'eq' => '_string_equals',
'==' => '_object_equals',
'""' => sub { return shift->render },
'bool' => sub {1},
'fallback' => 1,
);
__PACKAGE__->mk_attr_accessors(qw( id action enctype method ));
for my $name ( qw(
_elements
_output_processors
_valid_names
_plugins
_models
) )
{
has $name => (
is => 'rw',
default => sub { [] },
lazy => 1,
isa => 'ArrayRef',
);
}
has languages => (
is => 'rw',
default => sub { ['en'] },
lazy => 1,
isa => 'ArrayRef',
traits => ['FormFuChained'],
);
has input => (
is => 'rw',
default => sub { {} },
lazy => 1,
isa => 'HashRef',
traits => ['FormFuChained'],
);
has _processed_params => (
is => 'rw',
default => sub { {} },
lazy => 1,
isa => 'HashRef',
);
has form_error_message_class => (
is => 'rw',
default => 'form_error_message',
lazy => 1,
);
our @MULTIFORM_SHARED = (qw(
javascript
javascript_src
indicator
filename
query_type
force_error_message
localize_class
tt_module
nested_name
nested_subscript
default_model
tmp_upload_dir
params_ignore_underscore
));
for (@MULTIFORM_SHARED) {
has $_ => (
is => 'rw',
traits => ['FormFuChained'],
);
}
has submitted => ( is => 'rw', traits => ['FormFuChained'] );
has query => ( is => 'rw', traits => ['FormFuChained'] );
has _auto_fieldset => ( is => 'rw' );
__PACKAGE__->mk_output_accessors(qw( form_error_message ));
*elements = \&element;
*constraints = \&constraint;
*filters = \&filter;
*deflators = \&deflator;
*inflators = \&inflator;
*validators = \&validator;
*transformers = \&transformer;
*output_processors = \&output_processor;
*loc = \&localize;
*plugins = \&plugin;
*add_plugins = \&add_plugin;
our $build_defaults = {
action => '',
method => 'post',
filename => 'form',
render_method => 'string',
tt_args => {},
tt_module => 'Template',
query_type => 'CGI',
default_model => 'DBIC',
localize_class => 'HTML::FormFu::I18N',
auto_error_message => 'form_%s_%t',
error_tag => 'span',
};
sub BUILD {
my ( $self, $args ) = @_;
$self->populate($build_defaults);
return;
}
sub auto_fieldset {
my ( $self, $element_ref ) = @_;
# if there's no arg, just return whether there's an auto_fieldset already
return $self->_auto_fieldset if !$element_ref;
# if the argument isn't a reference, assume it's just a "1" meaning true,
# and use an empty hashref
if ( !ref $element_ref ) {
$element_ref = {};
}
$element_ref->{type} = 'Fieldset';
$self->element($element_ref);
$self->_auto_fieldset(1);
return $self;
}
sub default_values {
my ( $self, $default_ref ) = @_;
for my $field ( @{ $self->get_fields } ) {
my $name = $field->nested_name;
next if !defined $name;
next if !exists $default_ref->{$name};
$field->default( $default_ref->{$name} );
}
return $self;
}
sub model {
my ( $self, $model_name ) = @_;
$model_name ||= $self->default_model;
# search models already loaded
for my $model ( @{ $self->_models } ) {
return $model
if $model->type =~ /\Q$model_name\E$/;
}
# class not found, try require-ing it
my $class
= $model_name =~ s/^\+//
? $model_name
: "HTML::FormFu::Model::$model_name";
require_class($class);
my $model = $class->new( {
type => $model_name,
parent => $self,
} );
push @{ $self->_models }, $model;
return $model;
}
sub process {
my ( $self, $query ) = @_;
$self->input( {} );
$self->_processed_params( {} );
$self->_valid_names( [] );
$self->clear_errors;
$query ||= $self->query;
if ( defined $query && !blessed($query) ) {
$query = HTML::FormFu::FakeQuery->new( $self, $query );
}
# save it for further calls to process()
if ($query) {
DEBUG && debug( QUERY => $query );
$self->query($query);
}
# run all elements pre_process() methods
for my $elem ( @{ $self->get_elements } ) {
$elem->pre_process;
}
# run all plugins pre_process() methods
for my $plugin ( @{ $self->get_plugins } ) {
$plugin->pre_process;
}
# run all elements process() methods
for my $elem ( @{ $self->get_elements } ) {
$elem->process;
}
# run all plugins process() methods
for my $plugin ( @{ $self->get_plugins } ) {
$plugin->process;
}
my $submitted;
if ( defined $query ) {
eval { my @params = $query->param };
croak "Invalid query object: $@" if $@;
$submitted = $self->_submitted($query);
}
DEBUG_PROCESS && debug( SUBMITTED => $submitted );
$self->submitted($submitted);
if ($submitted) {
my %input;
my @params = $query->param;
for my $field ( @{ $self->get_fields } ) {
my $name = $field->nested_name;
next if !defined $name;
next if none { $name eq $_ } @params;
if ( $field->nested ) {
# call in list context so we know if there's more than 1 value
my @values = $query->param($name);
my $value
= @values > 1
? \@values
: $values[0];
$self->set_nested_hash_value( \%input, $name, $value );
}
else {
my @values = $query->param($name);
$input{$name}
= @values > 1
? \@values
: $values[0];
}
}
DEBUG && debug( INPUT => \%input );
# run all field process_input methods
for my $field ( @{ $self->get_fields } ) {
$field->process_input( \%input );
}
$self->input( \%input );
$self->_process_input;
}
# run all plugins post_process methods
for my $elem ( @{ $self->get_elements } ) {
$elem->post_process;
}
for my $plugin ( @{ $self->get_plugins } ) {
$plugin->post_process;
}
return;
}
sub _submitted {
my ( $self, $query ) = @_;
my $indicator = $self->indicator;
my $code;
if ( defined($indicator) && ref $indicator ne 'CODE' ) {
DEBUG_PROCESS && debug( INDICATOR => $indicator );
$code = sub { return defined $query->param($indicator) };
}
elsif ( !defined $indicator ) {
my @names = uniq
grep {defined}
map { $_->nested_name } @{ $self->get_fields };
DEBUG_PROCESS && debug( 'no indicator, checking fields...' => \@names );
$code = sub {
grep { defined $query->param($_) } @names;
};
}
else {
$code = $indicator;
}
return $code->( $self, $query );
}
sub _process_input {
my ($self) = @_;
$self->_build_params;
$self->_process_file_uploads;
$self->_filter_input;
$self->_constrain_input;
$self->_inflate_input if !@{ $self->get_errors };
$self->_validate_input if !@{ $self->get_errors };
$self->_transform_input if !@{ $self->get_errors };
$self->_build_valid_names;
return;
}
sub _build_params {
my ($self) = @_;
my $input = $self->input;
my %params;
for my $field ( @{ $self->get_fields } ) {
my $name = $field->nested_name;
next if !defined $name;
next if exists $params{$name};
next
if !$self->nested_hash_key_exists( $self->input, $name )
&& !$field->default_empty_value;
my $input = $self->get_nested_hash_value( $self->input, $name );
if ( ref $input eq 'ARRAY' ) {
# can't clone upload filehandles
# so create new arrayref of values
$input = [@$input];
}
elsif ( !defined $input && $field->default_empty_value ) {
$input = '';
}
$self->set_nested_hash_value( \%params, $name, $input, $name );
}
$self->_processed_params( \%params );
DEBUG_PROCESS && debug( 'PROCESSED PARAMS' => \%params );
return;
}
sub _process_file_uploads {
my ($self) = @_;
my @names = uniq
grep {defined}
map { $_->nested_name }
grep { $_->isa('HTML::FormFu::Element::File') } @{ $self->get_fields };
if (@names) {
my $query_class = $self->query_type;
if ( $query_class !~ /^\+/ ) {
$query_class = "HTML::FormFu::QueryType::$query_class";
}
require_class($query_class);
my $params = $self->_processed_params;
my $input = $self->input;
for my $name (@names) {
next if !$self->nested_hash_key_exists( $input, $name );
my $values = $query_class->parse_uploads( $self, $name );
$self->set_nested_hash_value( $params, $name, $values );
}
}
return;
}
sub _filter_input {
my ($self) = @_;
my $params = $self->_processed_params;
for my $filter ( @{ $self->get_filters } ) {
my $name = $filter->nested_name;
next if !defined $name;
next if !$self->nested_hash_key_exists( $params, $name );
$filter->process( $self, $params );
}
return;
}
sub _constrain_input {
my ($self) = @_;
my $params = $self->_processed_params;
for my $constraint ( @{ $self->get_constraints } ) {
DEBUG_CONSTRAINTS && debug(
'FIELD NAME' => $constraint->field->nested_name,
'CONSTRAINT TYPE' => $constraint->type,
);
$constraint->pre_process;
my @errors = eval { $constraint->process($params) };
DEBUG_CONSTRAINTS && debug( ERRORS => \@errors );
DEBUG_CONSTRAINTS && debug( '$@' => $@ );
if ( blessed $@ && $@->isa('HTML::FormFu::Exception::Constraint') ) {
push @errors, $@;
}
elsif ($@) {
push @errors, HTML::FormFu::Exception::Constraint->new;
}
for my $error (@errors) {
if ( !$error->parent ) {
$error->parent( $constraint->parent );
}
if ( !$error->constraint ) {
$error->constraint($constraint);
}
$error->parent->add_error($error);
}
}
return;
}
sub _inflate_input {
my ($self) = @_;
my $params = $self->_processed_params;
for my $inflator ( @{ $self->get_inflators } ) {
my $name = $inflator->nested_name;
next if !defined $name;
next if !$self->nested_hash_key_exists( $params, $name );
next if any {defined} @{ $inflator->parent->get_errors };
my $value = $self->get_nested_hash_value( $params, $name );
my @errors;
( $value, @errors ) = eval { $inflator->process($value) };
if ( blessed $@ && $@->isa('HTML::FormFu::Exception::Inflator') ) {
push @errors, $@;
}
elsif ($@) {
push @errors, HTML::FormFu::Exception::Inflator->new;
}
for my $error (@errors) {
$error->parent( $inflator->parent ) if !$error->parent;
$error->inflator($inflator) if !$error->inflator;
$error->parent->add_error($error);
}
$self->set_nested_hash_value( $params, $name, $value );
}
return;
}
sub _validate_input {
my ($self) = @_;
my $params = $self->_processed_params;
for my $validator ( @{ $self->get_validators } ) {
my $name = $validator->nested_name;
next if !defined $name;
next if !$self->nested_hash_key_exists( $params, $name );
next if any {defined} @{ $validator->parent->get_errors };
my @errors = eval { $validator->process($params) };
if ( blessed $@ && $@->isa('HTML::FormFu::Exception::Validator') ) {
push @errors, $@;
}
elsif ($@) {
push @errors, HTML::FormFu::Exception::Validator->new;
}
for my $error (@errors) {
$error->parent( $validator->parent ) if !$error->parent;
$error->validator($validator) if !$error->validator;
$error->parent->add_error($error);
}
}
return;
}
sub _transform_input {
my ($self) = @_;
my $params = $self->_processed_params;
for my $transformer ( @{ $self->get_transformers } ) {
my $name = $transformer->nested_name;
next if !defined $name;
next if !$self->nested_hash_key_exists( $params, $name );
next if any {defined} @{ $transformer->parent->get_errors };
my $value = $self->get_nested_hash_value( $params, $name );
my (@errors) = eval { $transformer->process( $value, $params ) };
if ( blessed $@ && $@->isa('HTML::FormFu::Exception::Transformer') ) {
push @errors, $@;
}
elsif ($@) {
push @errors, HTML::FormFu::Exception::Transformer->new;
}
for my $error (@errors) {
$error->parent( $transformer->parent ) if !$error->parent;
$error->transformer($transformer) if !$error->transformer;
$error->parent->add_error($error);
}
}
return;
}
sub _build_valid_names {
my ($self) = @_;
my $params = $self->_processed_params;
my $skip_private = $self->params_ignore_underscore;
my @errors = $self->has_errors;
my @names;
my %non_param;
for my $field ( @{ $self->get_fields } ) {
my $name = $field->nested_name;
next if !defined $name;
next if $skip_private && $field->name =~ /^_/;
if ( $field->non_param ) {
$non_param{$name} = 1;
}
elsif ( $self->nested_hash_key_exists( $params, $name ) ) {
push @names, $name;
}
}
push @names, uniq
grep { ref $params->{$_} ne 'HASH' }
grep { !( $skip_private && /^_/ ) }
grep { !exists $non_param{$_} }
keys %$params;
my %valid;
CHECK:
for my $name (@names) {
for my $error (@errors) {
next CHECK if $name eq $error;
}
$valid{$name}++;
}
my @valid = keys %valid;
$self->_valid_names( \@valid );
return;
}
sub _hash_keys {
my ( $hash, $subscript ) = @_;
my @names;
for my $key ( keys %$hash ) {
if ( ref $hash->{$key} eq 'HASH' ) {
push @names,
map { $subscript ? "${key}[${_}]" : "$key.$_" }
_hash_keys( $hash->{$key}, $subscript );
}
elsif ( ref $hash->{$key} eq 'ARRAY' ) {
push @names,
map { $subscript ? "${key}[${_}]" : "$key.$_" }
_array_indices( $hash->{$key}, $subscript );
}
else {
push @names, $key;
}
}
return @names;
}
sub _array_indices {
my ( $array, $subscript ) = @_;
my @names;
for my $i ( 0 .. $#{$array} ) {
if ( ref $array->[$i] eq 'HASH' ) {
push @names,
map { $subscript ? "${i}[${_}]" : "$i.$_" }
_hash_keys( $array->[$i], $subscript );
}
elsif ( ref $array->[$i] eq 'ARRAY' ) {
push @names,
map { $subscript ? "${i}[${_}]" : "$i.$_" }
_array_indices( $array->[$i], $subscript );
}
else {
push @names, $i;
}
}
return @names;
}
sub submitted_and_valid {
my ($self) = @_;
return $self->submitted && !$self->has_errors;
}
sub params {
my ($self) = @_;
return {} if !$self->submitted;
my @names = $self->valid;
my %params;
for my $name (@names) {
my @values = $self->param($name);
if ( @values > 1 ) {
$self->set_nested_hash_value( \%params, $name, \@values );
}
else {
$self->set_nested_hash_value( \%params, $name, $values[0] );
}
}
return \%params;
}
sub param {
my ( $self, $name ) = @_;
croak 'param method is readonly' if @_ > 2;
return if !$self->submitted;
if ( @_ == 2 ) {
return if !$self->valid($name);
my $value
= $self->get_nested_hash_value( $self->_processed_params, $name );
return if !defined $value;
if ( ref $value eq 'ARRAY' ) {
return wantarray ? @$value : $value->[0];
}
else {
return $value;
}
}
# return a list of valid names, if no $name arg
return $self->valid;
}
sub param_value {
my ( $self, $name ) = @_;
croak 'name parameter required' if @_ != 2;
return undef if !$self->valid($name);
# this is guaranteed to always return a single value
my $value = $self->get_nested_hash_value( $self->_processed_params, $name );
return ref $value eq 'ARRAY'
? $value->[0]
: $value;
}
sub param_array {
my ( $self, $name ) = @_;
croak 'name parameter required' if @_ != 2;
# guaranteed to always return an arrayref
return [] if !$self->valid($name);
my $value = $self->get_nested_hash_value( $self->_processed_params, $name );
return [] if !defined $value;
return ref $value eq 'ARRAY'
? $value
: [$value];
}
sub param_list {
my ( $self, $name ) = @_;
croak 'name parameter required' if @_ != 2;
# guaranteed to always return an arrayref
return if !$self->valid($name);
my $value = $self->get_nested_hash_value( $self->_processed_params, $name );
return if !defined $value;
return ref $value eq 'ARRAY'
? @$value
: $value;
}
sub valid {
my $self = shift;
return if !$self->submitted;
my @valid = @{ $self->_valid_names };
if (@_) {
my $name = shift;
return 1 if any { $name eq $_ } @valid;
# not found - see if it's the name of a nested block
my $parent;
if ( defined $self->nested_name && $self->nested_name eq $name ) {
$parent = $self;
}
else {
($parent)
= first { $_->isa('HTML::FormFu::Element::Block') }
@{ $self->get_all_elements( { nested_name => $name, } ) };
}
if ( defined $parent ) {
my $fail = any {defined}
map { @{ $_->get_errors } } @{ $parent->get_fields };
return 1 if !$fail;
}
return;
}
# return a list of valid names, if no $name arg
return @valid;
}
sub has_errors {
my $self = shift;
return if !$self->submitted;
my @names = map { $_->nested_name }
grep { @{ $_->get_errors } }
grep { defined $_->nested_name } @{ $self->get_fields };
if (@_) {
my $name = shift;
return 1 if any {/\Q$name/} @names;
return;
}
# return list of names with errors, if no $name arg
return @names;
}
sub add_valid {
my ( $self, $key, $value ) = @_;
croak 'add_valid requires arguments ($key, $value)' if @_ != 3;
$self->set_nested_hash_value( $self->input, $key, $value );
$self->set_nested_hash_value( $self->_processed_params, $key, $value );
if ( none { $_ eq $key } @{ $self->_valid_names } ) {
push @{ $self->_valid_names }, $key;
}
return $value;
}
sub _single_plugin {
my ( $self, $arg_ref ) = @_;
if ( !ref $arg_ref ) {
$arg_ref = { type => $arg_ref };
}
elsif ( ref $arg_ref eq 'HASH' ) {
# shallow clone
$arg_ref = {%$arg_ref};
}
else {
croak 'invalid args';
}
my $type = delete $arg_ref->{type};
my @return;
my @names = map { ref $_ ? @$_ : $_ }
grep {defined} ( delete $arg_ref->{name}, delete $arg_ref->{names} );
if (@names) {
# add plugins to appropriate fields
for my $x (@names) {
for my $field ( @{ $self->get_fields( { nested_name => $x } ) } ) {
my $new = $field->_require_plugin( $type, $arg_ref );
push @{ $field->_plugins }, $new;
push @return, $new;
}
}
}
else {
# add plugin directly to form
my $new = $self->_require_plugin( $type, $arg_ref );
push @{ $self->_plugins }, $new;
push @return, $new;
}
return @return;
}
around render => sub {
my $orig = shift;
my $self = shift;
my $plugins = $self->get_plugins;
for my $plugin (@$plugins) {
$plugin->render;
}
my $output = $self->$orig;
for my $plugin (@$plugins) {
$plugin->post_render( \$output );
}
return $output;
};
sub render_data {
my ( $self, $args ) = @_;
my $render = $self->render_data_non_recursive( {
elements => [ map { $_->render_data } @{ $self->_elements } ],
$args ? %$args : (),
} );
return $render;
}
sub render_data_non_recursive {
my ( $self, $args ) = @_;
my %render = (
filename => $self->filename,
javascript => $self->javascript,
javascript_src => $self->javascript_src,
attributes => xml_escape( $self->attributes ),
stash => $self->stash,
$args ? %$args : (),
);
$render{form} = \%render;
weaken( $render{form} );
$render{object} = $self;
if ($self->force_error_message
|| ( $self->has_errors
&& defined $self->form_error_message ) )
{
$render{form_error_message} = xml_escape( $self->form_error_message );
$render{form_error_message_class} = $self->form_error_message_class;
}
return \%render;
}
sub string {
my ( $self, $args_ref ) = @_;
$args_ref ||= {};
my $html = $self->_string_form_start( $args_ref );
# form template
$html .= "\n";
for my $element ( @{ $self->get_elements } ) {
# call render, so that child elements can use a different renderer
my $element_html = $element->render;
# skip Blank fields
if ( length $element_html ) {
$html .= $element_html . "\n";
}
}
$html .= $self->_string_form_end( $args_ref );
$html .= "\n";
return $html;
}
sub _string_form_start {
my ( $self, $args_ref ) = @_;
# start_form template
my $render_ref
= exists $args_ref->{render_data}
? $args_ref->{render_data}
: $self->render_data_non_recursive;
my $html = sprintf "";
}
sub start {
my $self = shift;
if ( 'tt' eq $self->render_method ) {
return $self->tt( {
filename => 'start_form',
render_data => $self->render_data_non_recursive,
} );
}
else {
return $self->_string_form_start( @_ );
}
}
sub end {
my $self = shift;
if ( 'tt' eq $self->render_method ) {
return $self->tt( {
filename => 'end_form',
render_data => $self->render_data_non_recursive,
} );
}
else {
return $self->_string_form_end( @_ );
}
}
sub hidden_fields {
my ($self) = @_;
return join $EMPTY_STR,
map { $_->render } @{ $self->get_fields( { type => 'Hidden' } ) };
}
sub output_processor {
my ( $self, $arg ) = @_;
my @return;
if ( ref $arg eq 'ARRAY' ) {
push @return, map { $self->_single_output_processor($_) } @$arg;
}
else {
push @return, $self->_single_output_processor($arg);
}
return @return == 1 ? $return[0] : @return;
}
sub _single_output_processor {
my ( $self, $arg ) = @_;
if ( !ref $arg ) {
$arg = { type => $arg };
}
elsif ( ref $arg eq 'HASH' ) {
$arg = Clone::clone($arg);
}
else {
croak 'invalid args';
}
my $type = delete $arg->{type};
my $new = $self->_require_output_processor( $type, $arg );
push @{ $self->_output_processors }, $new;
return $new;
}
sub _require_output_processor {
my ( $self, $type, $opt ) = @_;
croak 'required arguments: $self, $type, \%options' if @_ != 3;
croak "options argument must be hash-ref"
if reftype($opt) ne 'HASH';
my $class = $type;
if ( not $class =~ s/^\+// ) {
$class = "HTML::FormFu::OutputProcessor::$class";
}
$type =~ s/^\+//;
require_class($class);
my $object = $class->new( {
type => $type,
parent => $self,
} );
# handle default_args
my $parent = $self->parent;
if ( $parent && exists $parent->default_args->{output_processor}{$type} ) {
%$opt
= ( %{ $parent->default_args->{output_processer}{$type} }, %$opt );
}
$object->populate($opt);
return $object;
}
sub get_output_processors {
my $self = shift;
my %args = _parse_args(@_);
my @x = @{ $self->_output_processors };
if ( exists $args{type} ) {
@x = grep { $_->type eq $args{type} } @x;
}
return \@x;
}
sub get_output_processor {
my $self = shift;
my $x = $self->get_output_processors(@_);
return @$x ? $x->[0] : ();
}
__PACKAGE__->meta->make_immutable;
1;
__END__
=head1 NAME
HTML::FormFu - HTML Form Creation, Rendering and Validation Framework
=head1 SYNOPSIS
Note: These examples make use of L. As of
C v02.005, the L module is
not bundled with C and is available in a stand-alone
distribution.
use HTML::FormFu;
my $form = HTML::FormFu->new;
$form->load_config_file('form.yml');
$form->process( $cgi_query );
if ( $form->submitted_and_valid ) {
# do something with $form->params
}
else {
# display the form
$template->param( form => $form );
}
If you're using L, a more suitable example might be:
package MyApp::Controller::User;
use Moose;
extends 'Catalyst::Controller::HTML::FormFu';
sub user : FormFuChained CaptureArgs(1) {
my ( $self, $c, $id ) = @_;
my $rs = $c->model('Schema')->resultset('User');
$c->stash->{user} = $rs->find( $id );
return;
}
sub edit : FormFuChained('user') Args(0) FormConfig {
my ( $self, $c ) = @_;
my $form = $c->stash->{form};
my $user = $c->stash->{user};
if ( $form->submitted_and_valid ) {
$form->model->update( $user );
$c->res->redirect( $c->uri_for( "/user/$id" ) );
return;
}
$form->model->default_values( $user )
if ! $form->submitted;
}
Note: Because L is automatically called for you by the Catalyst
controller; if you make any modifications to the form within your action
method, such as adding or changing elements, adding constraints, etc;
you must call L again yourself before using L,
any of the methods listed under L"SUBMITTED FORM VALUES AND ERRORS"> or
L"MODIFYING A SUBMITTED FORM">, or rendering the form.
Here's an example of a config file to create a basic login form (all examples
here are L, but you can use any format supported by L),
you can also create forms directly in your perl code, rather than using an
external config file.
---
action: /login
indicator: submit
auto_fieldset: 1
elements:
- type: Text
name: user
constraints:
- Required
- type: Password
name: pass
constraints:
- Required
- type: Submit
name: submit
constraints:
- SingleValue
=head1 DESCRIPTION
L is a HTML form framework which aims to be as easy as
possible to use for basic web forms, but with the power and flexibility to
do anything else you might want to do (as long as it involves forms).
You can configure almost any part of formfu's behaviour and output. By
default formfu renders "XHTML 1.0 Strict" compliant markup, with as little
extra markup as possible, but with sufficient CSS class names to allow for a
wide-range of output styles to be generated by changing only the CSS.
All methods listed below (except L) can either be called as a normal
method on your C<$form> object, or as an option in your config file. Examples
will mainly be shown in L config syntax.
This documentation follows the convention that method arguments surrounded
by square brackets C<[]> are I, and all other arguments are
required.
=head1 BUILDING A FORM
=head2 new
Arguments: [\%options]
Return Value: $form
Create a new L object.
Any method which can be called on the L object may
instead be passed as an argument to L.
my $form = HTML::FormFu->new({
action => '/search',
method => 'GET',
auto_fieldset => 1,
});
=head2 load_config_file
Arguments: $filename
Arguments: \@filenames
Return Value: $form
Accepts a filename or list of file names, whose filetypes should be of any
format recognized by L.
The content of each config file is passed to L, and so are added
to the form.
L may be called in a config file itself, so as to allow
common settings to be kept in a single config file which may be loaded
by any form.
---
load_config_file:
- file1
- file2
YAML multiple documents within a single file. The document start marker is
a line containing 3 dashes. Multiple documents will be applied in order,
just as if multiple filenames had been given.
In the following example, multiple documents are taken advantage of to
load another config file after the elements are added. (If this were
a single document, the C would be called before
C, regardless of its position in the file).
---
elements:
- name: one
- name: two
---
load_config_file: ext.yml
Relative paths are resolved from the L directory if
it is set, otherwise from the current working directory.
See L for advice on organising config files.
=head2 config_callback
Arguments: \%options
If defined, the arguments are used to create a L
object during L which may be used to pre-process the
config before it is sent to L.
For example, the code below adds a callback to a form that will dynamically
alter any config value ending in ".yml" to end in ".yaml" when you call
L:
$form->config_callback({
plain_value => sub {
my( $visitor, $data ) = @_;
s/\.yml/.yaml/;
}
});
Default Value: not defined
This method is a special 'inherited accessor', which means it can be set on
the form, a block element or a single element. When the value is read, if
no value is defined it automatically traverses the element's hierarchy of
parents, through any block elements and up to the form, searching for a
defined value.
=head2 populate
Arguments: \%options
Return Value: $form
Each option key/value passed may be any L
method-name and arguments.
Provides a simple way to set multiple values, or add multiple elements to
a form with a single method-call.
Attempts to call the method-names in a semi-intelligent order (see
the source of populate() in C for details).
=head2 default_values
Arguments: \%defaults
Return Value: $form
Set multiple field's default values from a single hash-ref.
The hash-ref's keys correspond to a form field's name, and the value is
passed to the field's L.
This should be called after all fields have been added to the form, and
before L is called (otherwise, call L again before
rendering the form).
=head2 config_file_path
Arguments: $directory_name
L defines where configuration files will be
searched for, if an absolute path is not given to
L.
Default Value: not defined
This method is a special 'inherited accessor', which means it can be set on
the form, a block element or a single element. When the value is read, if
no value is defined it automatically traverses the element's hierarchy of
parents, through any block elements and up to the form, searching for a
defined value.
Is an L.
=head2 indicator
Arguments: $field_name
Arguments: \&coderef
If L is set to a fieldname, L will return true if
a value for that fieldname was submitted.
If L is set to a code-ref, it will be called as a subroutine
with the two arguments C<$form> and C<$query>, and its return value will be
used as the return value for L.
If L is not set, L will return true if a value for
any known fieldname was submitted.
=head2 auto_fieldset
Arguments: 1
Arguments: \%options
Return Value: $fieldset
This setting is suitable for most basic forms, and means you can generally
ignore adding fieldsets yourself.
Calling C<< $form->auto_fieldset(1) >> immediately adds a fieldset element to
the form. Thereafter, C<< $form->elements() >> will add all elements (except
fieldsets) to that fieldset, rather than directly to the form.
To be specific, the elements are added to the I fieldset on the form,
so if you add another fieldset, any further elements will be added to that
fieldset.
Also, you may pass a hashref to auto_fieldset(), and this will be used
to set defaults for the first fieldset created.
A few examples and their output, to demonstrate:
2 elements with no fieldset.
---
elements:
- type: Text
name: foo
- type: Text
name: bar
2 elements with an L.
---
auto_fieldset: 1
elements:
- type: Text
name: foo
- type: Text
name: bar
The 3rd element is within a new fieldset
---
auto_fieldset: { id: fs }
elements:
- type: Text
name: foo
- type: Text
name: bar
- type: Fieldset
- type: Text
name: baz
Because of this behaviour, if you want nested fieldsets you will have to add
each nested fieldset directly to its intended parent.
my $parent = $form->get_element({ type => 'Fieldset' });
$parent->element('fieldset');
=head2 form_error_message
Arguments: $string
Normally, input errors cause an error message to be displayed alongside the
appropriate form field. If you'd also like a general error message to be
displayed at the top of the form, you can set the message with
L.
To set the CSS class for the message, see L.
To change the markup used to display the message, edit the
C template file. See L.
Is an L to be displayed even if there are
no field errors.
=head2 default_args
Arguments: \%defaults
Set defaults which will be added to every element, constraint, etc. of the
given type which is subsequently added to the form.
For example, to make every C element automatically have a size of
C<10>, and make every C deflator automatically get its strftime
set to C<%d/%m/%Y>:
default_args:
elements:
Text:
size: 10
deflators:
Strftime:
strftime: '%d/%m/%Y'
An example to make all DateTime elements automatically get an appropriate
Strftime deflator and a DateTime inflator:
default_args:
elements:
DateTime:
deflators:
type: Strftime
strftime: '%d-%m-%Y'
inflators:
type: DateTime
parser:
strptime: '%d-%m-%Y'
=head3 Pseudo types
As a special case, you can also use the C keys C, C
and C to match any element which inherits from
L or which C
L or
L.
=head3 Alternatives
Each C key can contain an C list using the C<|> divider: e.g.
# apply the given class to any Element of type Password or Button
default_args:
elements:
'Password|Button':
attrs:
class: novalidate
=head3 Match ancestor
Each C key list can contain a type starting with C<+> to only
match elements with an ancestor of the given type: e.g.
# only apple the given class to an Input field within a Multi block
default_args:
elements:
'Input|+Multi':
attrs:
class: novalidate
=head3 Don't match ancestor
Each C key list can contain a type starting with C<-> to only
match elements who do not have an ancestor of the given type: e.g.
# apply the given class only to Input fields that are not in a Multi block
default_args:
elements:
'Input|-Multi':
attrs:
clasS: validate
=head3 Order
The arguments are applied in least- to most-specific order:
C, C, C, C<$type>. Within each of these, arguments are
applied in order of shortest-first to longest-last.
The C key must match the value returned by C, e.g.
L. If, for example, you have a custom element
outside of the C namespace, which you load via
C<< $form->element({ type => '+My::Custom::Element' }) >>, the key given to
L should B include the leading C<+>, as that is
stripped-out of the returned C value. Example:
# don't include the leading '+' here
default_args:
elements:
'My::Custom::Element':
attrs:
class: whatever
# do include the leading '+' here
elements:
- type: +My::Custom::Element
=head3 Clashes
L generates a single hashref to pass to L, merging
arguments for each type in turn - meaning L is only called once
in total - not once for each type.
Because scalar values are B merged - this means later values will
override earlier values: e.g.
# Normally, calling $field->add_attrs({ class => 'input' })
# then calling $field->add_attrs({ class => 'not-in-multi' })
# would result in both values being retained:
# class="input not-in-multi"
#
# However, default_args() creates a single data-structure to pass once
# to populate(), so any scalar values will overwrite earlier ones
# before they reach populate().
#
# The below example would result in the longest-matching key
# overwriting any others:
# class="not-in-multi"
#
default_args:
elements:
Input:
add_attrs:
class: input
'Input:-Multi':
add_attrs:
class: not-in-multi
=head3 Strictness
Note: Unlike the proper methods which have aliases, for example L
which is an alias for L - the keys given to C must
be of the plural form, e.g.:
default_args:
elements: {}
deflators: {}
filters: {}
constraints: {}
inflators: {}
validators: {}
transformers: {}
output_processors: {}
=head2 javascript
If set, the contents will be rendered within a C
EOF
is( "$form", $xhtml );
auto_label.t 100644 001751 001752 764 12331714662 20127 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t-aggregate/form use strict;
use warnings;
use Test::More tests => 2;
use HTML::FormFu;
use lib 't/lib';
my $form = HTML::FormFu->new(
{ tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );
$form->localize_class('HTMLFormFu::I18N')->id('form')->auto_label('label_%n');
$form->element('Text')->name('foo');
$form->element('Text')->name('bar')->auto_label('label_%f_%n');
like( $form->get_field('foo'), qr!! );
like( $form->get_field('bar'), qr!! );
param_list.t 100644 001751 001752 702 12331714662 20143 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t-aggregate/form use strict;
use warnings;
use Test::More tests => 3;
use HTML::FormFu;
my $form = HTML::FormFu->new;
$form->element('Text')->name('foo');
$form->element('Text')->name('bar');
$form->element('Text')->name('baz');
$form->process( {
foo => 'a',
bar => [ 'b', 'c' ],
} );
is_deeply( [ $form->param_list('foo') ], ['a'] );
is_deeply( [ $form->param_list('bar') ], [ 'b', 'c' ] );
is_deeply( [ $form->param_list('baz') ], [] );
has_errors.t 100644 001751 001752 1163 12331714662 20201 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t-aggregate/form use strict;
use warnings;
use Test::More tests => 6;
use HTML::FormFu;
my $form = HTML::FormFu->new;
$form->element('Text')->name('foo');
$form->element('Text')->name('bar');
$form->element('Text')->name('string');
$form->constraint( 'Number', 'foo', 'bar', 'string' );
$form->process( {
foo => 1,
bar => [ 2, 3 ],
string => 'yada',
} );
ok( !grep { $_ eq 'foo' } $form->has_errors );
ok( !grep { $_ eq 'bar' } $form->has_errors );
ok( grep { $_ eq 'string' } $form->has_errors );
ok( !$form->has_errors('foo') );
ok( !$form->has_errors('bar') );
ok( $form->has_errors('string') );
get_filter.t 100644 001751 001752 1226 12331714662 20156 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t-aggregate/form use strict;
use warnings;
use Test::More tests => 4;
use HTML::FormFu;
my $form = HTML::FormFu->new;
$form->element('Text')->name('name');
$form->element('Text')->name('age');
$form->filter( HTMLEscape => 'name', 'age' );
$form->filter( LowerCase => 'name' );
$form->filter('Whitespace');
{
my @filters = $form->get_filter;
is( @filters, 1, '1 filter' );
}
{
my @filters = $form->get_filter('name');
is( @filters, 1, '1 filter' );
}
{
my @filters = $form->get_filter( { name => 'age' } );
is( @filters, 1, '1 filter' );
}
{
my @filters = $form->get_filter( { type => 'LowerCase' } );
is( @filters, 1, '1 filter' );
}
attributes.t 100644 001751 001752 1342 12331714662 20217 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t-aggregate/form use strict;
use warnings;
use Test::More tests => 6;
use HTML::FormFu;
my $form = HTML::FormFu->new(
{ tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );
$form->id('foo')->action('/bar')->enctype('unknown')->method('get');
is( $form->id, 'foo', 'form id' );
is( $form->action, '/bar', 'form action' );
is( $form->enctype, 'unknown', 'form enctype' );
is( $form->method, 'get', 'form method' );
is_deeply(
$form->attributes,
{ id => 'foo',
action => '/bar',
enctype => 'unknown',
method => 'get',
},
'form attributes',
);
my $form_xhtml = <
EOF
is( "$form", $form_xhtml );
get_errors.t 100644 001751 001752 2606 12331714662 20210 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t-aggregate/form use strict;
use warnings;
use Test::More tests => 14;
use HTML::FormFu;
my $form = HTML::FormFu->new(
{ tt_args => { INCLUDE_PATH => 'share/templates/tt/xhtml' } } );
$form->element('Text')->name('foo');
$form->element('Text')->name('bar');
$form->element('Text')->name('string');
$form->constraint( 'Number', 'foo', 'bar', 'string' );
$form->process( {
foo => 1,
bar => [ 2, 'c' ],
string => 'yada',
} );
{
my $errors = $form->get_errors;
is( @$errors, 2 );
}
{
my $errors = $form->get_errors('bar');
is( @$errors, 1 );
is( $errors->[0]->name, 'bar' );
is( $errors->[0]->message, 'This field must be a number' )
}
{
my $errors = $form->get_errors( { name => 'string' } );
is( @$errors, 1 );
is( $errors->[0]->name, 'string' );
}
{
my $errors = $form->get_errors( { type => 'Number' } );
is( @$errors, 2 );
is( $errors->[0]->name, 'bar' );
is( $errors->[1]->name, 'string' );
}
{
my $errors = $form->get_errors( {
name => 'bar',
type => 'Number',
} );
is( @$errors, 1 );
is( $errors->[0]->name, 'bar' );
is( $errors->[0]->type, 'Number' );
is( $errors->[0]->stage, 'constraint' );
my $xhtml = qq{
This field must be a number
};
is( $form->get_field('bar'), $xhtml );
}
get_parent.t 100644 001751 001752 2777 12331714662 20176 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t-aggregate/form use strict;
use warnings;
use Test::More tests => 18;
use HTML::FormFu;
my $form = HTML::FormFu->new;
$form->load_config_file('t-aggregate/form/get_parent.yml');
$form->get_all_element( { type => 'Repeatable' } )->repeat(2);
$form->process;
my $fieldset = $form->get_element;
is( $fieldset->type, 'Fieldset' );
my $block_1 = $fieldset->get_element;
is( $block_1->name, 'block_1' );
my $block_1_1 = $block_1->get_element;
is( $block_1_1->name, 'block_1_1' );
my $text_1_1_1 = $block_1_1->get_element;
is( $text_1_1_1->name, 'text_1_1_1' );
my $repeatable = $block_1->get_elements->[1];
is( $repeatable->name, 'repeatable_1_2' );
my $rep_1 = $repeatable->get_element;
is( $rep_1->type, 'Block' );
my $rep_text_1 = $rep_1->get_element;
is( $rep_text_1->name, 'rep_text_1' );
my $rep_2 = $repeatable->get_elements->[1];
is( $rep_2->type, 'Block' );
my $rep_text_2 = $rep_2->get_element;
is( $rep_text_2->name, 'rep_text_2' );
my $submit_2 = $fieldset->get_elements->[1];
is( $submit_2->name, 'submit_2' );
###
ok( $text_1_1_1->get_parent() eq $block_1_1 );
ok( $text_1_1_1->get_parent( { tag => 'span' } ) eq $block_1_1 );
ok( $text_1_1_1->get_parent( { tag => 'div' } ) eq $block_1 );
ok( $text_1_1_1->get_parent( { type => 'Fieldset' } ) eq $fieldset );
###
ok( $rep_1->get_parent( { type => 'Repeatable' } ) eq $repeatable );
ok( $rep_2->get_parent( { type => 'Repeatable' } ) eq $repeatable );
ok( !defined $rep_2->get_parent( { type => 'Unknown' } ) );
ok( !defined $rep_2->get_parent( { foo => 'bar' } ) );
get_fields.t 100644 001751 001752 2323 12331714662 20136 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/t-aggregate/form use strict;
use warnings;
use Test::More tests => 19;
use HTML::FormFu;
my $form = HTML::FormFu->new;
my $fs = $form->element('Fieldset');
my $e1 = $fs->element('Text')->name('foo');
my $e2 = $fs->element('Hidden')->name('foo');
my $e3 = $fs->element('Hidden')->name('bar');
{
my $fields = $form->get_fields;
is( @$fields, 3 );
ok( $fields->[0] == $e1 );
ok( $fields->[1] == $e2 );
ok( $fields->[2] == $e3 );
ok( !@{ $e1->get_fields } );
ok( !@{ $e2->get_fields } );
ok( !@{ $e3->get_fields } );
}
{
my $fields = $form->get_fields( { type => 'Fieldset' } );
is( @$fields, 0 );
}
{
my $fields = $form->get_fields('foo');
is( @$fields, 2 );
ok( $fields->[0] == $e1 );
ok( $fields->[1] == $e2 );
}
{
my $fields = $form->get_fields( { name => 'foo' } );
is( @$fields, 2 );
ok( $fields->[0] == $e1 );
ok( $fields->[1] == $e2 );
}
{
my $fields = $form->get_fields( { type => 'Hidden' } );
is( @$fields, 2 );
ok( $fields->[0] == $e2 );
ok( $fields->[1] == $e3 );
}
{
my $fields = $form->get_fields( {
name => 'foo',
type => 'Hidden',
} );
is( @$fields, 1 );
ok( $fields->[0] == $e2 );
}
Constraint.pm 100644 001751 001752 36457 12331714662 17743 0 ustar 00carl carl 000000 000000 HTML-FormFu-2.01/lib/HTML/FormFu package HTML::FormFu::Constraint;
$HTML::FormFu::Constraint::VERSION = '2.01';
use Moose;
use MooseX::Attribute::FormFuChained;
extends 'HTML::FormFu::Processor';
use HTML::FormFu::Exception::Constraint;
use HTML::FormFu::Util qw(
DEBUG_CONSTRAINTS
DEBUG_CONSTRAINTS_WHEN
debug
);
use Clone ();
use List::MoreUtils qw( any );
use Scalar::Util qw( blessed );
use Carp qw( croak );
use Clone ();
use List::MoreUtils qw( any all );
use List::Util qw( first );
use Scalar::Util qw( reftype blessed );
has not => ( is => 'rw', traits => ['FormFuChained'] );
has force_errors => ( is => 'rw', traits => ['FormFuChained'] );
has when => ( is => 'rw', traits => ['FormFuChained'] );
has only_on_reps => ( is => 'rw', traits => ['FormFuChained'] );
sub repeatable_repeat {
my ( $self, $repeatable, $new_block ) = @_;
my $block_fields = $new_block->get_fields;
# rename any 'when' fields
{
my $when = $self->when;
if ( my $name = $when->{field} ) {
my $field = $repeatable->get_field_with_original_name( $name,
$block_fields );
if ( defined $field ) {
DEBUG_CONSTRAINTS && debug(
sprintf
"Repeatable renaming constraint 'when{field}' '%s' to '%s'",
$name, $field->nested_name,
);
$when->{field} = $field->nested_name;
}
}
elsif ( my $names = $when->{fields} ) {
for my $name (@$names) {
my $field = $repeatable->get_field_with_original_name( $name,
$block_fields );
if ( defined $field ) {
$when->{field} = $field->nested_name;
}
}
}
}
}
sub pre_process { }
sub process {
my ( $self, $params ) = @_;
return unless $self->_run_this_rep;
my $value = $self->_find_field_value($params);
my @errors;
# check when condition
if ( !$self->_process_when($params) ) {
DEBUG_CONSTRAINTS && debug('fail when() check - skipping constraint');
return;
}
if ( ref $value eq 'ARRAY' ) {
push @errors, eval { $self->constrain_values( $value, $params ) };
if ($@) {
push @errors,
$self->mk_errors( {
pass => 0,
message => $@,
} );
}
}
else {
my $ok = eval { $self->constrain_value( $value, $params ) };
DEBUG_CONSTRAINTS && debug( 'CONSTRAINT RETURN VALUE' => $ok );
DEBUG_CONSTRAINTS && debug( '$@' => $@ );
push @errors,
$self->mk_errors( {
pass => ( $@ || !$ok ) ? 0 : 1,
message => $@,
} );
}
return @errors;
}
sub _run_this_rep {
my ($self) = @_;
my $only_on_reps = $self->only_on_reps
or return 1;
my $current_rep = $self->field->repeatable_count
or return 1;
$only_on_reps = [$only_on_reps]
if ( reftype($only_on_reps) || '' ) ne 'ARRAY';
return first { $current_rep == $_ } @$only_on_reps;
}
sub _find_field_value {
my ( $self, $params ) = @_;
my $value = $self->get_nested_hash_value( $params, $self->nested_name );
my @fields_with_this_name
= @{ $self->form->get_fields( { nested_name => $self->nested_name } ) };
if ( @fields_with_this_name > 1 ) {
my $field = $self->parent;
my $index;
for ( my $i = 0; $i <= $#fields_with_this_name; ++$i ) {
if ( $fields_with_this_name[$i] eq $field ) {
$index = $i;
last;
}
}
croak 'did not find ourself - how can this happen?'
if !defined $index;
if ( ( reftype($value) || '' ) eq 'ARRAY' ) {
$value = $value->[$index];
}
elsif ( $index == 0 ) {
# keep $value
}
else {
undef $value;
}
}
return $value;
}
sub constrain_values {
my ( $self, $values, $params ) = @_;
my @errors;
for my $value (@$values) {
my $ok = eval { $self->constrain_value( $value, $params ) };
DEBUG_CONSTRAINTS && debug( 'CONSTRAINT RETURN VALUE' => $ok );
DEBUG_CONSTRAINTS && debug( '$@' => $@ );
push @errors,
$self->mk_errors( {
pass => ( $@ || !$ok ) ? 0 : 1,
message => $@,
} );
}
return @errors;
}
sub constrain_value {
croak "constrain_value() should be overridden";
}
sub mk_errors {
my ( $self, $args ) = @_;
my $pass = $args->{pass};
my $message = $args->{message};
my @errors;
my $force = $self->force_errors || $self->parent->force_errors;
if ( !$pass || $force ) {
my $error = $self->mk_error($message);
$error->forced(1) if $pass;
push @errors, $error;
}
return @errors;
}
sub mk_error {
my ( $self, $err ) = @_;
if ( !blessed $err || !$err->isa('HTML::FormFu::Exception::Constraint') ) {
$err = HTML::FormFu::Exception::Constraint->new;
}
return $err;
}
sub _process_when {
my ( $self, $params ) = @_;
# returns 1 if when condition is fullfilled or not defined
# returns 0 if when condition is defined and not fullfilled
# If it's a callback, return callback's return value (so 'when'
# condition is met if callback returns a true value)
# get when condition
my $when = $self->when;
return 1 if !defined $when;
# check type of 'when'
croak "Parameter 'when' is not a hash ref" if ref $when ne 'HASH';
# field or callback must be defined
my $when_field = $when->{field};
my $when_fields = $when->{fields};
my $when_any_field = $when->{any_field};
my $when_callback = $when->{callback};
croak
"'field', 'fields', 'any_field' or 'callback' key must be defined in 'when'"
if all { !defined } $when_field, $when_fields, $when_any_field,
$when_callback;
# Callback will be the preferred thing
if ($when_callback) {
no strict 'refs';
return $when_callback->( $params, $self );
}
my $any;
my @when_fields_value;
if ($when_any_field) {
croak "'any_field' is set to an empty list" if !@$when_any_field;
$any = 1;
@$when_fields = @$when_any_field;
}
if ($when_fields) {
croak "'fields' is set to an empty list" if !@$when_fields;
for my $name (@$when_fields) {
my $value = $self->get_nested_hash_value( $params, $name );
push @when_fields_value, $value
if defined $value;
}
}
else {
# nothing to constrain if field doesn't exist
my $value = $self->get_nested_hash_value( $params, $when_field );
push @when_fields_value, $value
if defined $value;
}
DEBUG_CONSTRAINTS_WHEN && debug( 'WHEN_FIELDS_VALUES' => \@when_fields_value );
if ( !@when_fields_value ) {
DEBUG_CONSTRAINTS_WHEN
&& debug("No 'when' fields values exist - returning false");
return 0;
}
my @values;
if ( defined( my $value = $when->{value} ) ) {
push @values, $value;
}
elsif ( defined( my $values = $when->{values} ) ) {
push @values, @$values;
}
# determine if condition is fulfilled
my @ok;
if (@values) {
for my $value (@when_fields_value) {
push @ok, any { $value eq $_ } @values;
}
}
else {
for my $value (@when_fields_value) {
push @ok, $value ? 1 : 0;
}
}
DEBUG_CONSTRAINTS_WHEN && debug( "'when' value matches" => \@ok );
my $return
= $any
? any { $when->{not} ? !$_ : $_ } @ok
: all { $when->{not} ? !$_ : $_ } @ok;
DEBUG_CONSTRAINTS_WHEN && debug( "'when' return value" => $return );
return $return;
}
sub fetch_error_message {
my ( $self ) = @_;
my $error = HTML::FormFu::Exception::Constraint->new({
form => $self->form,
parent => $self->parent,
processor => $self,
});
return $error->message;
}
sub clone {
my $self = shift;
my $clone = $self->SUPER::clone(@_);
if ( defined( my $when = $self->when ) ) {
$clone->when( Clone::clone $when );
}
return $clone;
}
__PACKAGE__->meta->make_immutable;
1;
__END__
=head1 NAME
HTML::FormFu::Constraint - Constrain User Input
=head1 SYNOPSIS
---
elements:
- type: Text
name: foo
constraints:
- type: Length
min: 8
when:
field: bar
values: [ 1, 3, 5 ]
- type: Text
name: bar
constraints:
- Integer
- Required
constraints:
- SingleValue
=head1 DESCRIPTION
User input is processed in the following order:
=over
=item L
=item L
=item L
=item L
=item L
=back
See L for further details.
L can be called on any L