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 dbcfb85

Browse filesBrowse files
authored
[HttpFoundation] Add a doc entry since Response's methods now accept immutable object
1 parent 473a1a5 commit dbcfb85
Copy full SHA for dbcfb85

File tree

1 file changed

+3
-1
lines changed
Filter options

1 file changed

+3
-1
lines changed

‎components/http_foundation.rst

Copy file name to clipboardExpand all lines: components/http_foundation.rst
+3-1Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,13 +400,15 @@ 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.
404+
403405
The :method:`Symfony\\Component\\HttpFoundation\\Response::setCache` method
404406
can be used to set the most commonly used cache information in one method
405407
call::
406408

407409
$response->setCache(array(
408410
'etag' => 'abcdef',
409-
'last_modified' => new \DateTime(),
411+
'last_modified' => new \DateTime(), // Any object implementing \DateTimeInterface
410412
'max_age' => 600,
411413
's_maxage' => 600,
412414
'private' => false,

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.