Skip to content

Commit

Permalink
minor #1977 [Doc] Minor syntax fixes in the Twig component docs (javi…
Browse files Browse the repository at this point in the history
…ereguiluz)

This PR was merged into the 2.x branch.

Discussion
----------

[Doc] Minor syntax fixes in the Twig component docs

| Q             | A
| ------------- | ---
| Bug fix?      | no
| New feature?  | no
| Issues        | -
| License       | MIT

Commits
-------

1efbcbd [Doc] Minor syntax fixes in the Twig component docs
  • Loading branch information
javiereguiluz committed Jul 11, 2024
2 parents f715061 + 1efbcbd commit 8b2afdc
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions src/TwigComponent/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -483,17 +483,20 @@ component use a ``PreMount`` hook::

.. note::

In its default configuration, the OptionsResolver treats all props.
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.
To avoid this, use the `ignoreUndefined()` method with `true`. See `ignore not defined options`_ for more info.
In its default configuration, the OptionsResolver treats all props.
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.
To avoid this, use the ``ignoreUndefined()`` method with ``true``.
See `ignore not defined options`_ for more info::
$resolver->setIgnoreUndefined(true);
$resolver->setIgnoreUndefined(true);
The major drawback of this configuration is that the OptionsResolver will remove every non-defined option when resolving data.
To maintain props that have not been defined within the OptionsResolver, combine the data from the hook with the resolved data.
The major drawback of this configuration is that the OptionsResolver will
remove every non-defined option when resolving data. To maintain props that
have not been defined within the OptionsResolver, combine the data from the
hook with the resolved data::
return $resolver->resolve($data) + $data;

return $resolver->resolve($data) + $data;

The data returned from ``preMount()`` will be used as the props for mounting.

Expand Down

0 comments on commit 8b2afdc

Please sign in to comment.