Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 82ea3ac

Browse filesBrowse files
Added the new doc in a note
1 parent dbcfb85 commit 82ea3ac
Copy full SHA for 82ea3ac

File tree

1 file changed

+7
-2
lines changed
Filter options

1 file changed

+7
-2
lines changed

‎components/http_foundation.rst

Copy file name to clipboardExpand all lines: components/http_foundation.rst
+7-2Lines changed: 7 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.