Uri\WhatWg\Url::withPath
En esta página
Uri\WhatWg\Url::withPath
Modifica el componente de ruta
Descripción#
public Uri\WhatWg\Url::withPath(string $path): static
```php
Crea una nueva URL y modifica su componente de ruta.
## Parámetros
`path`
Nuevo componente de ruta.
## Valores devueltos
La instancia de `Uri\WhatWg\Url` modificada.
## Errores/Excepciones
Si la URL resultante es inválida, se lanza una excepción Uri\WhatWg\InvalidUrlException.
## Ejemplos
Ejemplo básico de Uri\WhatWg\Url::withPath
```php
El ejemplo anterior mostrará:
/baz
Véase también#
Uri\WhatWg\Url::getPath
Uri\Rfc3986\Uri::withPath