-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03a00e0
commit 769549c
Showing
2 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?php | ||
|
||
namespace Atomic\Views; | ||
namespace Atomic\Models; | ||
|
||
/* | ||
* Created for AtomicPHP Framework | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace Atomic\Utilities; | ||
|
||
/* | ||
* Created for AtomicPHP Framework | ||
* Copyright 2011 Shane Perreault All Rights Reserved | ||
*/ | ||
|
||
class FlashData { | ||
|
||
/** | ||
* FlashData Accessor Method | ||
* FlashData is readable persistence | ||
* data that gets deleted once it is | ||
* read. | ||
*/ | ||
|
||
public function __get($key) { | ||
if(!isset($_SESSION["flashdata_" . $key])) { | ||
return null; | ||
} | ||
$value = $_SESSION["flashdata_" . $key]; | ||
unset($_SESSION["flashdata_" . $key]); | ||
return $value; | ||
} | ||
|
||
/** | ||
* FlashData mutator method | ||
* Sets a flash Data value | ||
*/ | ||
|
||
public function __set($key, $value) { | ||
$_SESSION["flashdata_" . $key] = $value; | ||
} | ||
|
||
} |