Form::Toolkit::Field - A field for JCOM::Form s
Returns a unique id of this field in the space of all forms in the process.
Usage:
my $id = $this->id();
Returns a fast clone of this field.
Returns a shallow clone of the contained value (can be undef)
Returns the string value of this field.
Chainable placeholder(..);
Placeholder. This is an extra hint, like an example of what to enter for users. Very useful for HMTL5 interfaces.
Chainable help() method.
Chainable label method.
Adds an error string to this field.
Returns the number of errors in this form.
Does nothing. Can be extended by roles.
Resets this field value and errors
Adds a Subrole of Form::Toolkit::FieldRole or a custom defined FormRole. Additionnaly, you can provide new parameters if the role you're applying requires some mandatory attributes.
Returns the field so you can chain calls.
$this->add_role('Mandatory') ->add_role('+My::App::FieldRole::Whatever'); ->add_role('RegExpMatch', { regexp_match => qr/^[A-Z]+$/ });
Returns an array of Roles this field implements.
Returns true if this field does the given role.
if( $this->does_role('Mandatory') ){ ... } if( $this->does_role('+My::Specific::Role') ){ ... }
Accessor shortcut for meta short class.
$this->short_class();
To install Form::Toolkit, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Form::Toolkit
CPAN shell
perl -MCPAN -e shell install Form::Toolkit
For more information on module installation, please visit the detailed CPAN module installation guide.