Skip to content

Commit 9357d51

Browse files
author
Sander De la Marche
committed
Add a file name and namespace to the code example
1 parent e753ff1 commit 9357d51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

components/http_foundation.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,11 @@ UrlHelper
717717

718718
Generating absolute (and relative) URLs for a given path is a common need in lots of applications. In Twig templates this is trivial thanks to the absolute_url() and relative_path() functions. The same functionality can be found in the :class:`Symfony\\Component\\HttpFoundation\\UrlHelper` class, which can be injected as a service anywhere in your application. This class provides two public methods called getAbsoluteUrl() and getRelativePath()::
719719

720-
Use Symfony\Component\HttpFoundation\UrlHelper;
720+
// src/Normalizer/UserApiNormalizer.php
721+
722+
namespace App\Normalizer;
723+
724+
use Symfony\Component\HttpFoundation\UrlHelper;
721725

722726
class UserApiNormalizer
723727
{

0 commit comments

Comments
 (0)