xeoscript/phorms

There is no license information available for the latest version (dev-data-driven) of this package.

Maintainers

Details

github.com/xeoscript/phorms

Source

Installs: 9

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 2

Forks: 9

Language:CSS

dev-data-driven 2013-10-14 21:01 UTC

This package is not auto-updated.

Last update: 2024-05-06 12:40:44 UTC


README

tf198's changes

Functional Changes:

  • Fixes for Decimal, Integer, DateTime, DropDown and CheckBox fields
  • Allowing override of input type in Text widget (for extended HTML5 types: date url etc...)
  • Changed how values passed via $data parameter are handled so there is a symmetric relationship between it and the validated output of Phorm::cleaned_data(). Before you couldn't display a form for stored data because certain fields like Phorm_Field_Date were populated by one type (string) and returned another (unix timestamp). All such fields should now provide an export_value($value) method that performs the inverse of import_value($value).
  • Added Range and IPv4Address fields

Non-Functional Changes:

  • Added PHPUnit tests

petsagouris's changes

Functional Changes:

  • Removed client side validation to keep this library focused on PHP (not javascript)
  • Added Alpha/Alphanumeric field type
  • Added OptionGroup (multi-select checkbox) field type

Non-Functional Changes:

  • Made sure the examples (in the examples folder) were working as expected and that the code was clean.
  • Note that the original branch developer has been contacted but has not responded -- this branch should probably be considered the most active.

jordanlev's changes

Functional Changes:

  • Changed name of Phorm_Field_Numeric to Phorm_Field_Integer because that's what it is (numeric is misleading because php's is_numeric() function checks for any kind of number, not just integers).
  • Added $size parameter to Decimal and Integer field types instead of hard-coding "20".
  • Simplified built-in 'required' validation (just add 'required' to any field's validation array) [Implementation Details: I removed the "Validation.class.php" file because it made no sense, and replaced it with a simple built-in function that is automatically called when is_valid() is called if the validation array contains 'required'].
  • Changed default form method from 'get' to 'post' in the Phorm_Phorm constuctor ('post' is a more common use case so it should be the default)
  • Added a display_errors() function that can be called on your phorm object to output a list of all field errors -- useful if you want to display all errors at the top of the page instead of inline with each feild.
  • Added a new public fields() function to Phorm_Phorm class so all field objects can be retrieved and looped through.
  • Text and Integer fields now set HTML maxlength attribute based on $max_length param (in addition to existing server-side validation check).
  • Bugfix: The is_valid() function in Field.class.php now works with instance callbacks as well as function names, to match documented behaviour.

Non-Functional Changes:

  • Added new designed_form.php example to demonstrate how to use the class in your own templated / designed HTML form (as opposed to an auto-generated table), and to show off the new display_errors() and fields() functions.
  • Removed getIterator() function in Phorm/Phorm.class.php becaue it wasn't doing anything (class doesn't implement IteratorAggregate)
  • Removed leftover debugging call to var_dump() in Phorm/Field/Email.class.php
  • Cleaned up some function comments in Phorm/Field.class.php
  • Removed docs/ directory because it was autogenerated before I made all of these changes, so it was out of date (and I haven't re-generated it with phpDocumentor yet).
  • Added constant for target directory to the file_drop.php example