Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updating session component, to not use layout, and use elements instead.

Tests updated.
  • Loading branch information...
commit 17e81ab3464036a08b9f753ad9c7c7739dad9277 1 parent 1bedd84
@markstory markstory authored
View
10 cake/libs/controller/components/session.php
@@ -1,8 +1,6 @@
<?php
/**
- * Short description for file.
- *
- * Long description for file
+ * SessionComponent. Provides access to Sessions from the Controller layer
*
* PHP versions 4 and 5
*
@@ -231,15 +229,15 @@ function error() {
* Additional params below can be passed to customize the output, or the Message.[key]
*
* @param string $message Message to be flashed
- * @param string $layout Layout to wrap flash message in
+ * @param string $element Element to wrap flash message in.
* @param array $params Parameters to be sent to layout as view variables
* @param string $key Message key, default is 'flash'
* @access public
*/
- function setFlash($message, $layout = 'default', $params = array(), $key = 'flash') {
+ function setFlash($message, $element = 'default', $params = array(), $key = 'flash') {
if ($this->__active === true) {
$this->__start();
- $this->write('Message.' . $key, compact('message', 'layout', 'params'));
+ $this->write('Message.' . $key, compact('message', 'element', 'params'));
}
}
View
8 cake/tests/cases/libs/controller/components/session.test.php
@@ -324,16 +324,16 @@ function testSessionFlash() {
$this->assertNull($Session->read('Message.flash'));
$Session->setFlash('This is a test message');
- $this->assertEqual($Session->read('Message.flash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array()));
+ $this->assertEqual($Session->read('Message.flash'), array('message' => 'This is a test message', 'element' => 'default', 'params' => array()));
$Session->setFlash('This is a test message', 'test', array('name' => 'Joel Moss'));
- $this->assertEqual($Session->read('Message.flash'), array('message' => 'This is a test message', 'layout' => 'test', 'params' => array('name' => 'Joel Moss')));
+ $this->assertEqual($Session->read('Message.flash'), array('message' => 'This is a test message', 'element' => 'test', 'params' => array('name' => 'Joel Moss')));
$Session->setFlash('This is a test message', 'default', array(), 'myFlash');
- $this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array()));
+ $this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'element' => 'default', 'params' => array()));
$Session->setFlash('This is a test message', 'non_existing_layout');
- $this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array()));
+ $this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'element' => 'default', 'params' => array()));
$Session->delete('Message');
}
Please sign in to comment.
Something went wrong with that request. Please try again.