Spark-Form

 view release on metacpan or  search on metacpan

README  view on Meta::CPAN

    add it to the form. Requires the second argument to be a string name for
    the field to identify it in the form. Rest will become %kwargs If it is
    an ArrayRef, it loops over the contents (Useful for custom fields, will
    probably result in bugs for string field names).@rest will be passed in
    each iteration. If it looks sufficiently like a field (implements
    Spark::Form::Field), then it will add it to the list of fields. @rest
    will just become %kwargs

    Uses 'field name' to locate it from the data passed in.

    This is a streaming interface, it returns the form itself.

  validate
    Validates the form. Sets "valid" and then also returns the value.

  data
    Allows you to pass in a HashRef of data to populate the fields with
    before validation. Useful if you don't use a plugin to automatically
    populate the data.

    This is a streaming interface, it returns the form itself.

  fields () => Fields
    Returns a list of Fields in the form in their current order

  BUILD
    Moose constructor. Test::Pod::Coverage made me do it. Adds "class" to
    the search path for field modules.

  get (Str)
    Returns the form field of that name

lib/Spark/Form.pm  view on Meta::CPAN

=head2 add ($thing,@rest)

If $thing is a string, attempts to instantiate a plugin of that type and add it
to the form. Requires the second argument to be a string name for the field to identify it in the form. Rest will become %kwargs
If it is an ArrayRef, it loops over the contents (Useful for custom fields, will probably result in bugs for string field names).@rest will be passed in each iteration.
If it looks sufficiently like a field (implements Spark::Form::Field),
then it will add it to the list of fields. @rest will just become %kwargs

Uses 'field name' to locate it from the data passed in.

This is a B<streaming interface>, it returns the form itself.

=head2 validate

Validates the form. Sets C<valid> and then also returns the value.

=head2 data

Allows you to pass in a HashRef of data to populate the fields with before validation. Useful if you don't use a plugin to automatically populate the data.

This is a B<streaming interface>, it returns the form itself.

=head2 fields () => Fields

Returns a list of Fields in the form in their current order

=head2 BUILD

Moose constructor. Test::Pod::Coverage made me do it.
Adds C<class> to the search path for field modules.



( run in 0.309 second using v1.01-cache-2.11-cpan-4d50c553e7e )