diff --git a/.travis.yml b/.travis.yml index 64bd958..8eb1d27 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,22 @@ +sudo: false language: perl matrix: fast_finish: true perl: - - "5.22" - - "5.20" - - "5.18" - - "5.16" - - "5.14" + - '5.24' + - '5.22' + - '5.20' + - '5.18' + - '5.16' + - '5.14' before_install: - - git clone git://github.com/travis-perl/helpers ~/travis-perl-helpers - - source ~/travis-perl-helpers/init - - build-perl - - perl -V - - "cpanm -nq --installdeps ." - - "cpanm -qn Test::Requires::Git" - - "cpanm -qn Devel::Cover::Report::Codecov" + - git config --global user.name "TravisCI" + - git config --global user.email $HOSTNAME":not-for-mail@travis-ci.org" +install: + - cpanm --quiet --notest Dist::Zilla Dist::Zilla::App::Command::cover App::cpm Devel::Cover::Report::Codecov + - cpm install -w 2 --mirror=http://cpan.cpantesters.org/ -g $(dzil authordeps --missing) + - cpm install -w 2 --mirror=http://cpan.cpantesters.org/ -g $(dzil listdeps --author --missing) + script: - perl Makefile.PL && make test && cover -test -report codecov + - dzil smoke --release --author && dzil cover -test -report codecov && dzil xtest + diff --git a/LICENSE b/LICENSE deleted file mode 100644 index 2e3d5be..0000000 --- a/LICENSE +++ /dev/null @@ -1,207 +0,0 @@ -This software is Copyright (c) 2015 by Binary.com. - -This is free software, licensed under: - - The Apache License, Version 2.0, January 2004 - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index 4a9ecd4..0000000 --- a/MANIFEST +++ /dev/null @@ -1,27 +0,0 @@ -.travis.yml -Changes -example/app.psgi -lib/HTML/FormBuilder.pm -lib/HTML/FormBuilder/Base.pm -lib/HTML/FormBuilder/Field.pm -lib/HTML/FormBuilder/FieldSet.pm -lib/HTML/FormBuilder/Select.pm -lib/HTML/FormBuilder/Validation.pm -LICENSE -Makefile.PL -MANIFEST This list of files -README.md -t/basic.t -t/csrf.t -t/formbuilder.t -t/formbuilder/base.t -t/formbuilder/field.t -t/formbuilder/fieldset.t -t/formbuilder/select.t -t/formbuilder/validation.t -t/formbuilder_output.t -t/lib/BaseTest.pm -t/lib/TestHelper.pm -t/perlcritic.t -t/rc/.perlcriticrc -t/rc/.perltidyrc diff --git a/Makefile.PL b/Makefile.PL index 8b50886..73f8805 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -1,40 +1,79 @@ -use 5.014; +# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.007. use strict; use warnings; -use ExtUtils::MakeMaker; - - -WriteMakefile( - NAME => "HTML::FormBuilder", - AUTHOR => "Chylli L", - VERSION_FROM => "lib/HTML/FormBuilder.pm", - ABSTRACT_FROM => "lib/HTML/FormBuilder.pm", - LICENSE => "apache_2", - MIN_PERL_VERSION => "5.014", - CONFIGURE_REQUIRES => { - "ExtUtils::MakeMaker" => 0 - }, - BUILD_REQUIRES => { - "Test::Exception" => 0, - "Test::FailWarnings" => 0, - "Test::More" => "0.96", - "Test::Perl::Critic" => 0 - }, - PREREQ_PM => { - "Carp" => 0, - "Class::Std::Utils" => 0, - "Encode" => 0, - "HTML::Entities" => 0, - "Moo" => 0, - "Scalar::Util" => 0, - "URI::Escape" => 0, - "namespace::clean" => 0, - "String::Random" => 0 - }, - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' }, - clean => { FILES => 'HTML-FormBuilder-*' }, - test => { - "TESTS" => "t/*.t t/formbuilder/*.t" - } + +use 5.014000; + +use ExtUtils::MakeMaker 6.48; + +my %WriteMakefileArgs = ( + "ABSTRACT" => "A Multi-part HTML form", + "AUTHOR" => "binary.com ", + "CONFIGURE_REQUIRES" => { + "ExtUtils::MakeMaker" => "6.48" + }, + "DISTNAME" => "HTML-FormBuilder", + "LICENSE" => "perl", + "MIN_PERL_VERSION" => "5.014000", + "NAME" => "HTML::FormBuilder", + "PREREQ_PM" => { + "Carp" => 0, + "Class::Std::Utils" => 0, + "Encode" => 0, + "HTML::Entities" => 0, + "Moo" => 0, + "Scalar::Util" => 0, + "String::Random" => 0, + "URI::Escape" => 0, + "namespace::clean" => 0 + }, + "TEST_REQUIRES" => { + "ExtUtils::MakeMaker" => 0, + "File::Spec" => 0, + "IO::Handle" => 0, + "IPC::Open3" => 0, + "Test::CheckDeps" => "0.010", + "Test::Exception" => 0, + "Test::FailWarnings" => 0, + "Test::More" => "0.96", + "Test::Perl::Critic" => 0 + }, + "VERSION" => "0.12", + "test" => { + "TESTS" => "t/*.t t/formbuilder/*.t" + } ); + +my %FallbackPrereqs = ( + "Carp" => 0, + "Class::Std::Utils" => 0, + "Encode" => 0, + "ExtUtils::MakeMaker" => 0, + "File::Spec" => 0, + "HTML::Entities" => 0, + "IO::Handle" => 0, + "IPC::Open3" => 0, + "Moo" => 0, + "Scalar::Util" => 0, + "String::Random" => 0, + "Test::CheckDeps" => "0.010", + "Test::Exception" => 0, + "Test::FailWarnings" => 0, + "Test::More" => "0.96", + "Test::Perl::Critic" => 0, + "URI::Escape" => 0, + "namespace::clean" => 0 +); + + +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); diff --git a/cpanfile b/cpanfile new file mode 100644 index 0000000..a114505 --- /dev/null +++ b/cpanfile @@ -0,0 +1,21 @@ +requires 'Carp'; +requires 'Class::Std::Utils'; +requires 'Encode'; +requires 'HTML::Entities'; +requires 'Moo'; +requires 'Scalar::Util'; +requires 'String::Random'; +requires 'URI::Escape'; +requires 'namespace::clean'; +requires 'perl', '5.014'; + +on configure => sub { + requires 'ExtUtils::MakeMaker'; +}; + +on test => sub { + requires 'Test::Exception'; + requires 'Test::FailWarnings'; + requires 'Test::More', '0.96'; + requires 'Test::Perl::Critic'; +}; diff --git a/dist.ini b/dist.ini new file mode 100644 index 0000000..1b22f24 --- /dev/null +++ b/dist.ini @@ -0,0 +1,69 @@ +name = HTML-FormBuilder +author = binary.com +license = Perl_5 +copyright_holder = binary.com +copyright_year = 2017 + +[Git::GatherDir] +exclude_filename = Makefile.PL +include_dotfiles = 1 +[PruneCruft] +except = t/rc/\.perl.*rc$ +[ManifestSkip] +[MetaYAML] +[License] +[Readme] +[MakeMaker] +eumm_version = 6.48 +prereq_fatal = 1 +[ExecDir] +[ShareDir] +dir = share +[Manifest] +[TestRelease] +[ConfirmRelease] +[Prereqs::FromCPANfile] +[Prereqs / BuildRequires] +perl = 5.014000 +[CheckPrereqsIndexed] +[CheckExtraTests] +[NextRelease] +[VersionFromModule] +[ReversionOnRelease] +[OurPkgVersion] +[GitHub::Meta] +repo = binary-com/perl-HTML-FormBuilder +[InstallGuide] +[MetaJSON] +[InsertExample] +[PerlTidy] +perltidyrc = t/rc/.perltidyrc +[PodSyntaxTests] +[MojibakeTests] +[Test::CheckDeps] +[Test::Compile] +;[Test::Synopsis] +[Test::EOL] +[Test::Version] +[Test::Pod::LinkCheck] +[PodCoverageTests] +[Test::UnusedVars] +[Test::ReportPrereqs] +[Test::Perl::Critic] +critic_config = t/rc/.perlcriticrc +[SpellingCommonMistakesTests] +[CopyFilesFromRelease] +filename = lib/HTML/FormBuilder.pm +filename = Makefile.PL +[Git::Commit] +allow_dirty = dist.ini +allow_dirty = cpanfile +allow_dirty = Changes +allow_dirty = Makefile.PL +allow_dirty = lib/HTML/FormBuilder.pm +[Git::Tag] +tag_format = v%v +tag_message = Tag v%v for CPAN release +[InstallRelease] +install_command = carton install +[UploadToCPAN] diff --git a/lib/HTML/FormBuilder.pm b/lib/HTML/FormBuilder.pm index 9716bfc..62656ed 100644 --- a/lib/HTML/FormBuilder.pm +++ b/lib/HTML/FormBuilder.pm @@ -3,7 +3,7 @@ package HTML::FormBuilder; use strict; use warnings; use 5.008_005; -our $VERSION = '0.11'; +our $VERSION = '0.12'; use Carp; use HTML::FormBuilder::FieldSet; @@ -47,7 +47,7 @@ has after_form => ( has csrftoken => (is => 'ro'); sub BUILDARGS { - my ($class, @args) = @_; + my (undef, @args) = @_; my %args = (@args % 2) ? %{$args[0]} : @args; # set default class @@ -441,7 +441,6 @@ sub _link_button { ##################################################################### sub _wrap_fieldset { my ($self, $fieldset_html) = @_; - my $output = ''; my $fieldset_template = <
@@ -555,6 +554,20 @@ The parameter is the fieldset index to which you want to add the field and the f the data in the $form will be changed when build the form. So you cannot get the same result if you call build twice. +=head2 BUILDARGS + +=head2 build_confirmation_button_with_all_inputs_hidden + +=head2 csrftoken + +=head2 get_field_error_message + +=head2 get_field_value + +=head2 set_field_error_message + +=head2 set_field_value + =head1 Cookbook =head2 a full sample @@ -723,13 +736,13 @@ read for more details =head1 AUTHOR -Chylli L +Chylli L =head1 CONTRIBUTOR -Fayland Lam L +Fayland Lam L -Tee Shuwn Yuan L +Tee Shuwn Yuan L =head1 COPYRIGHT AND LICENSE diff --git a/lib/HTML/FormBuilder/Base.pm b/lib/HTML/FormBuilder/Base.pm index 90a7054..a151ddb 100644 --- a/lib/HTML/FormBuilder/Base.pm +++ b/lib/HTML/FormBuilder/Base.pm @@ -3,12 +3,13 @@ package HTML::FormBuilder::Base; use strict; use warnings; use 5.008_005; -our $VERSION = '0.11'; use Carp; use Moo; use namespace::clean; +## VERSION + our $CLASSES = { fieldset_group => 'fieldset_group', no_stack_field_parent => 'no_stack_field_parent', @@ -128,13 +129,13 @@ please refer to L. =head1 AUTHOR -Chylli L +Chylli L =head1 CONTRIBUTOR -Fayland Lam L +Fayland Lam L -Tee Shuwn Yuan L +Tee Shuwn Yuan L =head1 COPYRIGHT AND LICENSE diff --git a/lib/HTML/FormBuilder/Field.pm b/lib/HTML/FormBuilder/Field.pm index 4b15dc8..857cddb 100644 --- a/lib/HTML/FormBuilder/Field.pm +++ b/lib/HTML/FormBuilder/Field.pm @@ -3,7 +3,6 @@ package HTML::FormBuilder::Field; use strict; use warnings; use 5.008_005; -our $VERSION = '0.11'; use Carp; use Scalar::Util qw(weaken blessed); @@ -12,6 +11,8 @@ use Moo; use namespace::clean; extends qw(HTML::FormBuilder::Base); +## VERSION + has data => ( is => 'ro', isa => sub { @@ -24,7 +25,7 @@ has data => ( ); sub BUILDARGS { - my ($class, @args) = @_; + my (undef, @args) = @_; my %args = (@args % 2) ? %{$args[0]} : @args; my $data = $args{data}; @@ -150,7 +151,6 @@ sub build { sub _build_input { my $self = shift; my $input_field = shift; - my $env = shift; my $html = ''; @@ -285,15 +285,23 @@ HTML::FormBuilder::Field - Field container used by HTML::FormBuilder $form->add_field($fieldset_index, {input => {type => 'text', value => 'Join'}}); +=head1 METHODS + +=head2 BUILDARGS + +=head2 build + +=head2 data + =head1 AUTHOR -Chylli L +Chylli L =head1 CONTRIBUTOR -Fayland Lam L +Fayland Lam L -Tee Shuwn Yuan L +Tee Shuwn Yuan L =head1 COPYRIGHT AND LICENSE diff --git a/lib/HTML/FormBuilder/FieldSet.pm b/lib/HTML/FormBuilder/FieldSet.pm index 1a78d22..0791935 100644 --- a/lib/HTML/FormBuilder/FieldSet.pm +++ b/lib/HTML/FormBuilder/FieldSet.pm @@ -3,7 +3,6 @@ package HTML::FormBuilder::FieldSet; use strict; use warnings; use 5.008_005; -our $VERSION = '0.11'; use HTML::FormBuilder::Field; use Carp; @@ -13,6 +12,8 @@ use Moo; use namespace::clean; extends qw(HTML::FormBuilder::Base); +## VERSION + has data => ( is => 'ro', isa => sub { @@ -159,7 +160,7 @@ sub _build_fieldset_foreword { ##################################################################### sub _wrap_fieldset { my ($self, $fieldset_html) = @_; - my $output = ''; + my $fieldset_template = <
@@ -212,15 +213,17 @@ append the field into fieldset and return that field append fields into fieldset and return the number of fields added. +=head2 data + =head1 AUTHOR -Chylli L +Chylli L =head1 CONTRIBUTOR -Fayland Lam L +Fayland Lam L -Tee Shuwn Yuan L +Tee Shuwn Yuan L =head1 COPYRIGHT AND LICENSE diff --git a/lib/HTML/FormBuilder/Select.pm b/lib/HTML/FormBuilder/Select.pm index f2599bb..a91f7f1 100644 --- a/lib/HTML/FormBuilder/Select.pm +++ b/lib/HTML/FormBuilder/Select.pm @@ -2,12 +2,12 @@ package HTML::FormBuilder::Select; use strict; use warnings; -our $VERSION = '0.11'; - use Carp; use Moo; use namespace::clean; +## VERSION + =head1 NAME HTML::FormBuilder::Select - Select Element Handling for BOM Forms @@ -125,6 +125,10 @@ sub hidden_html { return ''; } +=head2 is_str + +=cut + sub is_str { die "$_[0] is not a string" unless defined($_[0]) && !ref($_[0]); return 1; diff --git a/lib/HTML/FormBuilder/Validation.pm b/lib/HTML/FormBuilder/Validation.pm index 5043320..a9ddf7d 100755 --- a/lib/HTML/FormBuilder/Validation.pm +++ b/lib/HTML/FormBuilder/Validation.pm @@ -2,7 +2,6 @@ package HTML::FormBuilder::Validation; use strict; use warnings; -our $VERSION = '0.11'; use Carp; use Class::Std::Utils; @@ -15,6 +14,8 @@ use Moo; use namespace::clean; extends qw(HTML::FormBuilder); +## VERSION + has has_error_of => ( is => 'rw', default => 0, @@ -64,7 +65,6 @@ sub build { my $self = shift; my $print_fieldset_index = shift; - my $html; my $javascript_validation = ''; # build the fieldset, if $print_fieldset_index is specifed then we only generate that praticular fieldset with that index @@ -437,7 +437,7 @@ sub _encode_text { =head1 NAME -HTML::FormBuilder::Validation - An extention of the Form object, to allow for javascript-side validation of inputs +HTML::FormBuilder::Validation - An extension of the Form object, to allow for javascript-side validation of inputs and also server-side validation after the form is POSTed =head1 SYNOPSIS @@ -727,6 +727,14 @@ validate form input and return true or false check the erorr is founded in the input element or not +=head2 get_has_error + +=head2 set_field_error_message + +=head2 set_server_side_checks + +=head2 validate_csrf + =head1 CROSS SITE REQUEST FORGERY PROTECTION for plain CGI or other framework, read Dancer example below. @@ -761,7 +769,7 @@ for plain CGI or other framework, read Dancer example below. =head2 CSRF and Mojolicious -if you're using L and have DefaultHelpers plugin enabled, it's simple to add csrftoken in Validation->new as below: +if you're using Mojolicious and have DefaultHelpers plugin enabled, it's simple to add csrftoken in Validation->new as below: my $form = HTML::FormBuilder::Validation->new(data => $form_attributes, csrftoken => $c->csrf_token); @@ -769,13 +777,13 @@ Mojolicious $c->csrf_token will handle the session part for you. =head1 AUTHOR -Chylli L +Chylli L =head1 CONTRIBUTOR -Fayland Lam L +Fayland Lam L -Tee Shuwn Yuan L +Tee Shuwn Yuan L =head1 COPYRIGHT AND LICENSE diff --git a/t/perlcritic.t b/t/perlcritic.t deleted file mode 100644 index 7ca4adf..0000000 --- a/t/perlcritic.t +++ /dev/null @@ -1,8 +0,0 @@ -#!perl - -if (!require Test::Perl::Critic) { - Test::More::plan(skip_all => "Test::Perl::Critic required for testing PBP compliance"); -} - -Test::Perl::Critic->import(-profile => 't/rc/.perlcriticrc'); -Test::Perl::Critic::all_critic_ok();