Repository navigation
v0.4.0
Showing stored data, a forms helper, and FormSchema::describe() as groundwork for visual
builders. No breaking changes.
Added
Form::present($data)turns stored data, such as a saved submission, into readable rows:
field labels, option labels instead of values (including groups and provider options),
Yes/No for checkboxes and lists for multi-value fields. Values no longer among the options
are shown as stored. Passwords, buttons and uploads are never included.
Form::renderPresented($data)renders them with the newpresentedtheme view.Contracts\PresentableFieldInterface(isPresentable(),presentValue()), implemented by
every field; custom fields can overridepresentValue(), for example to format amounts.- Config
$presentYes,$presentNo,$presentEmptyand theme classespresented,
presented_label,presented_value,presented_empty. - A
formshelper (helper('forms')) withforms_load(),forms_check()and
forms_present(). Functions are prefixedforms_so they never clash with CodeIgniter's
formhelper. FormSchema::describe($policy)describes what a schema may contain under a policy, as
JSON-ready data: every allowed field type with its label, accepted keys, the kind of value
each key takes and a one-line explanation, which keys are required (requires) or cannot be
combined (exclusive), plus the allowed rules with their parameter kinds, attributes,
option providers, upload types, size limits and forbidden names. Groundwork for visual
builders and admin help pages; a test loads every described key through the loader under
each policy, so the description and the loader cannot disagree.SchemaLoader::keysFor()(the loader's own key lists, shared withdescribe()) and
SchemaPolicy::getRules(),getAttributes(),getForbiddenNames(),getLimits().