File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -331,7 +331,7 @@ names): e.g. ``https://example.com`` will be valid but ``https://example`` won't
331
331
``tldMessage ``
332
332
~~~~~~~~~~~~~~
333
333
334
- **type **: ``string `` **default **: ``TThis URL does not contain a TLD. ``
334
+ **type **: ``string `` **default **: ``This URL does not contain a TLD. ``
335
335
336
336
.. versionadded :: 7.1
337
337
@@ -360,6 +360,7 @@ Parameter Description
360
360
class Website
361
361
{
362
362
#[Assert\Url(
363
+ requireTld: true,
363
364
tldMessage: 'Add at least one TLD to the {{ value }} URL.',
364
365
)]
365
366
protected string $homepageUrl;
@@ -372,6 +373,7 @@ Parameter Description
372
373
properties :
373
374
homepageUrl :
374
375
- Url :
376
+ requireTld : true
375
377
tldMessage : Add at least one TLD to the {{ value }} URL.
376
378
377
379
.. code-block :: xml
@@ -385,6 +387,7 @@ Parameter Description
385
387
<class name =" App\Entity\Website" >
386
388
<property name =" homepageUrl" >
387
389
<constraint name =" Url" >
390
+ <option name =" requireTld" >true</option >
388
391
<option name =" tldMessage" >Add at least one TLD to the {{ value }} URL.</option >
389
392
</constraint >
390
393
</property >
@@ -406,6 +409,7 @@ Parameter Description
406
409
public static function loadValidatorMetadata(ClassMetadata $metadata): void
407
410
{
408
411
$metadata->addPropertyConstraint('homepageUrl', new Assert\Url([
412
+ 'requireTld' => true,
409
413
'tldMessage' => 'Add at least one TLD to the {{ value }} URL.',
410
414
]));
411
415
}
You can’t perform that action at this time.
0 commit comments