Skip to content

Commit 82ea3ac

Browse files
Added the new doc in a note
1 parent dbcfb85 commit 82ea3ac

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

components/http_foundation.rst

+7-2
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,20 @@ of methods to manipulate the HTTP headers related to the cache:
400400
* :method:`Symfony\\Component\\HttpFoundation\\Response::setEtag`;
401401
* :method:`Symfony\\Component\\HttpFoundation\\Response::setVary`;
402402

403-
The methods :method:`Symfony\\Component\\HttpFoundation\\Response::setExpires`, :method:`Symfony\\Component\\HttpFoundation\\Response::setLastModified` and :method:`Symfony\\Component\\HttpFoundation\\Response::setData` accepts an immutable date object.
403+
.. note::
404+
405+
The methods :method:`Symfony\\Component\\HttpFoundation\\Response::setExpires`,
406+
:method:`Symfony\\Component\\HttpFoundation\\Response::setLastModified` and
407+
:method:`Symfony\\Component\\HttpFoundation\\Response::setDate` accept any
408+
object that implements ``\DateTimeInterface``, including immutable date objects.
404409

405410
The :method:`Symfony\\Component\\HttpFoundation\\Response::setCache` method
406411
can be used to set the most commonly used cache information in one method
407412
call::
408413

409414
$response->setCache(array(
410415
'etag' => 'abcdef',
411-
'last_modified' => new \DateTime(), // Any object implementing \DateTimeInterface
416+
'last_modified' => new \DateTime(),
412417
'max_age' => 600,
413418
's_maxage' => 600,
414419
'private' => false,

0 commit comments

Comments
 (0)