Skip to content

Commit a971f7c

Browse files
committed
Fixes
1 parent d6ae7bb commit a971f7c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

reference/constraints/Url.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ names): e.g. ``https://example.com`` will be valid but ``https://example`` won't
331331
``tldMessage``
332332
~~~~~~~~~~~~~~
333333

334-
**type**: ``string`` **default**: ``TThis URL does not contain a TLD.``
334+
**type**: ``string`` **default**: ``This URL does not contain a TLD.``
335335

336336
.. versionadded:: 7.1
337337

@@ -360,6 +360,7 @@ Parameter Description
360360
class Website
361361
{
362362
#[Assert\Url(
363+
requireTld: true,
363364
tldMessage: 'Add at least one TLD to the {{ value }} URL.',
364365
)]
365366
protected string $homepageUrl;
@@ -372,6 +373,7 @@ Parameter Description
372373
properties:
373374
homepageUrl:
374375
- Url:
376+
requireTld: true
375377
tldMessage: Add at least one TLD to the {{ value }} URL.
376378
377379
.. code-block:: xml
@@ -385,6 +387,7 @@ Parameter Description
385387
<class name="App\Entity\Website">
386388
<property name="homepageUrl">
387389
<constraint name="Url">
390+
<option name="requireTld">true</option>
388391
<option name="tldMessage">Add at least one TLD to the {{ value }} URL.</option>
389392
</constraint>
390393
</property>
@@ -406,6 +409,7 @@ Parameter Description
406409
public static function loadValidatorMetadata(ClassMetadata $metadata): void
407410
{
408411
$metadata->addPropertyConstraint('homepageUrl', new Assert\Url([
412+
'requireTld' => true,
409413
'tldMessage' => 'Add at least one TLD to the {{ value }} URL.',
410414
]));
411415
}

0 commit comments

Comments
 (0)