You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feature #967 [Live] Method Name changes in ComponentWithFormTrait + expanded docs (weaverryan)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[Live] Method Name changes in ComponentWithFormTrait + expanded docs
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | yes (the method name changes)
| Tickets | None
| License | MIT
Using live components to render a dynamic form is turning out to be a very popular thing to do. The downside is that, in some ways, the form system doesn't "play well" when used so dynamically, which can cause confusion. In this PR:
A) In the docs, I've renamed the property that is bound to your form class to `initialFormData` to *really* emphasize that this is the ORIGINAL data used to create the form. It will not represent the *new* data until the form is submitted. I've also clarified this further in the docs.
B) Updated the docs to talk more about `$this->formValues` and when data is and isn't updated during the lifecycle.
C) Renamed some methods in `ComponentWithFormTrait`: `getFormInstance()` -> `getForm()` and `getForm()` -> `getFormView()`. That's a BC break, and it's going to be annoying... which gives me hesitation. But these are currently named incorrectly (the reason goes back to an old version of live components to help name the variable `form` in the template).
Cheers!
Commits
-------
940ec67 [Live] Method Name changes in ComponentWithFormTrait + expanded docs
0 commit comments