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

[Validator] Add docs for bridge twig validator #20836 #20863

Merged
merged 1 commit into from
Apr 10, 2025

Conversation

sfmok
Copy link
Contributor

@sfmok sfmok commented Apr 7, 2025

This pull request adds documentation for the new Twig Validator constraint introduced in the Twig Bridge.

Changes:

  • Added a page to document the Twig validator constraint, including:
  • Installation instructions for the symfony/twig-bridge package.
  • Usage of the constraint in Symfony applications.
  • Detailed options available, including message and skipDeprecations.
  • Updated index.rst to include the new page under the "Topics" section for the Twig Bridge.

Related Issue:
Issue #20836 - Add docs for Twig validator

Related PR:
Symfony PR #58805 – Introduced the Twig validator constraint in the Twig Bridge.

@carsonbot carsonbot added this to the 7.3 milestone Apr 7, 2025
Comment on lines 23 to 25
Twig template:

.. code-block:: php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Twig template:
.. code-block:: php
Twig template::

Comment on lines 53 to 55
set this to `false`.

.. code-block:: php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
set this to `false`.
.. code-block:: php
set this to `false`::

@sfmok sfmok force-pushed the docs/bridge-twig-validator branch from 90b3c8e to 7f3faf7 Compare April 8, 2025 18:54
@sfmok sfmok force-pushed the docs/bridge-twig-validator branch from 7f3faf7 to ac9e20c Compare April 8, 2025 19:05
@sfmok
Copy link
Contributor Author

sfmok commented Apr 8, 2025

@OskarStark done, but I think this #20872 needs to be merged first

@carsonbot carsonbot changed the title Add docs for bridge twig validator #20836 [Validator] Add docs for bridge twig validator #20836 Apr 10, 2025
@javiereguiluz javiereguiluz merged commit 6a73077 into symfony:7.3 Apr 10, 2025
2 of 3 checks passed
@sfmok sfmok deleted the docs/bridge-twig-validator branch April 10, 2025 07:16
@javiereguiluz
Copy link
Member

@sfmok thanks a lot for contributing these docs!

Your contribution was perfectly correct, but we changed some things while merging. The fact that this constraint is stored in the Twig Bridge is an "implementation detail" that most users don't care about. We have other similar constraints (e.g. UniqueEntity from Doctrine Bridge) that are documented like a normal constraint, without explaining in detail that it belongs to a bridge.

So, we made some changes (see 344d8ba) to remove the new twig_bridge/ docs and move the contents to reference/constraints/Twig.rst.

Also, even if the constraint page titles only use the name of the constraint (e.g. just Json, IsNull, etc.) we decided to title the new page as Twig Constraint to avoid confusion with the pages related to Twig templating (in Google search results, in symfony.com search engine, etc.)

Thanks!

@sfmok
Copy link
Contributor Author

sfmok commented Apr 10, 2025

@sfmok thanks a lot for contributing these docs!

Your contribution was perfectly correct, but we changed some things while merging. The fact that this constraint is stored in the Twig Bridge is an "implementation detail" that most users don't care about. We have other similar constraints (e.g. UniqueEntity from Doctrine Bridge) that are documented like a normal constraint, without explaining in detail that it belongs to a bridge.

So, we made some changes (see 344d8ba) to remove the new twig_bridge/ docs and move the contents to reference/constraints/Twig.rst.

Also, even if the constraint page titles only use the name of the constraint (e.g. just Json, IsNull, etc.) we decided to title the new page as Twig Constraint to avoid confusion with the pages related to Twig templating (in Google search results, in symfony.com search engine, etc.)

Thanks!

Got it, that makes perfect sense. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants