Skip to content
This repository
Browse code

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

Tests updated.
  • Loading branch information...
commit 17e81ab3464036a08b9f753ad9c7c7739dad9277 1 parent 1bedd84
Mark Story authored
10  cake/libs/controller/components/session.php
... ...
@@ -1,8 +1,6 @@
1 1
 <?php
2 2
 /**
3  
- * Short description for file.
4  
- *
5  
- * Long description for file
  3
+ * SessionComponent.  Provides access to Sessions from the Controller layer
6 4
  *
7 5
  * PHP versions 4 and 5
8 6
  *
@@ -231,15 +229,15 @@ function error() {
231 229
  * Additional params below can be passed to customize the output, or the Message.[key]
232 230
  *
233 231
  * @param string $message Message to be flashed
234  
- * @param string $layout Layout to wrap flash message in
  232
+ * @param string $element Element to wrap flash message in.
235 233
  * @param array $params Parameters to be sent to layout as view variables
236 234
  * @param string $key Message key, default is 'flash'
237 235
  * @access public
238 236
  */
239  
-	function setFlash($message, $layout = 'default', $params = array(), $key = 'flash') {
  237
+	function setFlash($message, $element = 'default', $params = array(), $key = 'flash') {
240 238
 		if ($this->__active === true) {
241 239
 			$this->__start();
242  
-			$this->write('Message.' . $key, compact('message', 'layout', 'params'));
  240
+			$this->write('Message.' . $key, compact('message', 'element', 'params'));
243 241
 		}
244 242
 	}
245 243
 
8  cake/tests/cases/libs/controller/components/session.test.php
@@ -324,16 +324,16 @@ function testSessionFlash() {
324 324
 		$this->assertNull($Session->read('Message.flash'));
325 325
 
326 326
 		$Session->setFlash('This is a test message');
327  
-		$this->assertEqual($Session->read('Message.flash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array()));
  327
+		$this->assertEqual($Session->read('Message.flash'), array('message' => 'This is a test message', 'element' => 'default', 'params' => array()));
328 328
 
329 329
 		$Session->setFlash('This is a test message', 'test', array('name' => 'Joel Moss'));
330  
-		$this->assertEqual($Session->read('Message.flash'), array('message' => 'This is a test message', 'layout' => 'test', 'params' => array('name' => 'Joel Moss')));
  330
+		$this->assertEqual($Session->read('Message.flash'), array('message' => 'This is a test message', 'element' => 'test', 'params' => array('name' => 'Joel Moss')));
331 331
 
332 332
 		$Session->setFlash('This is a test message', 'default', array(), 'myFlash');
333  
-		$this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array()));
  333
+		$this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'element' => 'default', 'params' => array()));
334 334
 
335 335
 		$Session->setFlash('This is a test message', 'non_existing_layout');
336  
-		$this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'layout' => 'default', 'params' => array()));
  336
+		$this->assertEqual($Session->read('Message.myFlash'), array('message' => 'This is a test message', 'element' => 'default', 'params' => array()));
337 337
 
338 338
 		$Session->delete('Message');
339 339
 	}

0 notes on commit 17e81ab

Please sign in to comment.
Something went wrong with that request. Please try again.