Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Minor syntax fixes in the Twig component docs #1977

Merged
merged 1 commit into from
Jul 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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