Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Rotua Panjaitan
yii2
Commits
3d2cac53
Commit
3d2cac53
authored
Aug 18, 2014
by
restyler
Committed by
Qiang Xue
Aug 18, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Multiple flash messages per type support
parent
c0d771f7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
Session.php
framework/web/Session.php
+10
-4
No files found.
framework/web/Session.php
View file @
3d2cac53
...
...
@@ -717,7 +717,13 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
{
$counters
=
$this
->
get
(
$this
->
flashParam
,
[]);
$counters
[
$key
]
=
$removeAfterAccess
?
-
1
:
0
;
$_SESSION
[
$key
]
=
$value
;
if
(
!
empty
(
$_SESSION
[
$key
]))
{
$_SESSION
[
$key
][]
=
$value
;
}
else
{
$_SESSION
[
$key
]
=
[
$value
];
}
$_SESSION
[
$this
->
flashParam
]
=
$counters
;
}
...
...
@@ -760,9 +766,9 @@ class Session extends Component implements \IteratorAggregate, \ArrayAccess, \Co
}
/**
* Returns a value indicating whether there
is a flash message
associated with the specified key.
* @param string $key key identifying the flash message
* @return boolean whether
the specified flash message exists
* Returns a value indicating whether there
are flash messages
associated with the specified key.
* @param string $key key identifying the flash message
type
* @return boolean whether
any flash messages exist under specified key
*/
public
function
hasFlash
(
$key
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment