Skip to content

Commit 989167f

Browse files
committed
docs: add docs
1 parent 4c55a28 commit 989167f

File tree

3 files changed

+21
-1
lines changed

3 files changed

+21
-1
lines changed

user_guide_src/source/changelogs/v4.5.0.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,8 @@ Others
268268
usage in your view files, which was supported by CodeIgniter 3.
269269
- **CSP:** Added ``ContentSecurityPolicy::clearDirective()`` method to clear
270270
existing CSP directives. See :ref:`csp-clear-directives`.
271+
- **HTTP:** Added ``Message::addHeader()`` method to add another header with
272+
the same name. See :php:meth:`CodeIgniter\\HTTP\\Message::addHeader()`.
271273

272274
Message Changes
273275
***************

user_guide_src/source/incoming/message.rst

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ requests and responses, including the message body, protocol version, utilities
77
the headers, and methods for handling content negotiation.
88

99
This class is the parent class that both the :doc:`Request Class <../incoming/request>` and the
10-
:doc:`Response Class <../outgoing/response>` extend from.
10+
:doc:`Response Class <../outgoing/response>` extend from, and it is not used directly.
1111

1212
***************
1313
Class Reference
@@ -146,6 +146,20 @@ Class Reference
146146

147147
.. literalinclude:: message/009.php
148148

149+
.. php:method:: addHeader($name, $value)
150+
151+
.. versionadded:: 4.5.0
152+
153+
:param string $name: The name of the header to add.
154+
:param string $value: The value of the header.
155+
:returns: The current message instance
156+
:rtype: CodeIgniter\\HTTP\\Message
157+
158+
Adds a header (not a header value) with the same name.
159+
Use this only when you set multiple headers with the same name,
160+
161+
.. literalinclude:: message/011.php
162+
149163
.. php:method:: getProtocolVersion()
150164
151165
:returns: The current HTTP protocol version
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
3+
$message->addHeader('Set-Cookie', 'logged_in=no; Path=/');
4+
$message->addHeader('Set-Cookie', 'sessid=123456; Path=/');

0 commit comments

Comments
 (0)