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
minor #1845 [TwigComponent] Update DOC preMount validation data code (cavasinf)
This PR was squashed before being merged into the 2.x branch.
Discussion
----------
[TwigComponent] Update DOC preMount validation data code
| Q | A
| ------------- | ---
| Bug fix? | no
| New feature? | no
| Issues | Fix#1704 <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
Fixes the missing doc part as discussed in #1704
Commits
-------
6c14a78 [TwigComponent] Update DOC preMount validation data code
In its default configuration, the OptionsResolver treats all props.
487
+
However, if more props are passed than the options defined in the OptionsResolver, an error will be prompted, indicating that one or more options do not exist.
488
+
To avoid this, use the `ignoreUndefined()` method with `true`. See `ignore not defined options`_ for more info.
489
+
490
+
$resolver->setIgnoreUndefined(true);
491
+
492
+
The major drawback of this configuration is that the OptionsResolver will remove every non-defined option when resolving data.
493
+
To maintain props that have not been defined within the OptionsResolver, combine the data from the hook with the resolved data.
494
+
495
+
return $resolver->resolve($data) + $data;
496
+
497
+
482
498
The data returned from ``preMount()`` will be used as the props for mounting.
0 commit comments