Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve field property handling (#20)
* Make field properties dynamic Instead of accessing and setting properties on a static config array, we are now calling the property methods on demand. This is helpful if you change a field in the `hydratedFields` callback. For instance, if you change the options of a select field, the default value will now automatically take those new options into account. Before this change, you had to manually change the default value to reflect the changes made to the options. * Use fallback of `get` method * Make inline label translatable * Get handle from handle method * Make properties changeable * Move unchangeable methods into class `id`, `handle`, and `key` are essential field properties that should never be changed. They are different from config properties like `options` and `default`. * The `view` is also an unchangeable property * Keys should always be snake case * Make integer input type changeable * Fix captcha response being saved to file * Fresh composer.lock * Make the view a changeable property again * Fix styling * Update README.md * Make things look prettier with shorter syntax * Make lines more readable * Fall back to config item if property doesn’t exist * Update README.md * Update README.md * Preserve the captcha response on form reset * Fix styling * Make sure we can get multi-word keys with methods * Make view a property instead of constant * Users should use the magic methods and properties * Use get_class_methods instead of ReflectionClass * Make it look prettier with arrow function * Improve readability * Limit access to methods that contain `Property` * Move properties back to traits Co-authored-by: aerni <aerni@users.noreply.github.com>
- Loading branch information