[ Index ]
 

Code source de CakePHP 1.1.13.4450

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/cake/libs/controller/components/ -> session.php (sommaire)

Short description for file. Long description for file

Copyright: Copyright 2005-2007, Cake Software Foundation, Inc.
License: http://www.opensource.org/licenses/mit-license.php The MIT License
Version: $Revision: 4409 $
Poids: 257 lignes (7 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

SessionComponent:: (13 méthodes):
  __construct()
  startup()
  write()
  read()
  del()
  delete()
  check()
  error()
  setFlash()
  flash()
  renew()
  valid()
  destroy()


Classe: SessionComponent  - X-Ref

Session Component.

Session handling from the controller.

__construct($base = null)   X-Ref
Class constructor

param: string $base

startup(&$controller)   X-Ref
Startup method.  Copies controller data locally for rendering flash messages.

param: object $controller

write($name, $value)   X-Ref
Used to write a value to a session key.

In your controller: $this->Session->write('Controller.sessKey', 'session value');

param: string $name The name of the key your are setting in the session.
param: string $value The value you want to store in a session.

read($name = null)   X-Ref
Used to read a session values for a key or return values for all keys.

In your controller: $this->Session->read('Controller.sessKey');
Calling the method without a param will return all session vars

param: string $name the name of the session key you want to read
return: values from the session vars

del($name)   X-Ref
Used to delete a session variable.

In your controller: $this->Session->del('Controller.sessKey');

param: string $name
return: boolean, true is session variable is set and can be deleted, false is variable was not set.

delete($name)   X-Ref
Wrapper for SessionComponent::del();

In your controller: $this->Session->delete('Controller.sessKey');

param: string $name
return: boolean, true is session variable is set and can be deleted, false is variable was not set.

check($name)   X-Ref
Used to check if a session variable is set

In your controller: $this->Session->check('Controller.sessKey');

param: string $name
return: boolean true is session variable is set, false if not

error()   X-Ref
Used to determine the last error in a session.

In your controller: $this->Session->error();

return: string Last session error

setFlash($flashMessage, $layout = 'default', $params = array()   X-Ref
Used to set a session variable that can be used to output messages in the view.

In your controller: $this->Session->setFlash('This has been saved');

Additional params below can be passed to customize the output, or the Message.[key]

param: string $flashMessage Message to be flashed
param: string $layout Layout 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'

flash($key = 'flash')   X-Ref
This method is deprecated.
You should use $session->flash('key'); in your views


renew()   X-Ref
Used to renew a session id

In your controller: $this->Session->renew();

valid()   X-Ref
Used to check for a valid session.

In your controller: $this->Session->valid();

return: boolean true is session is valid, false is session is invalid

destroy()   X-Ref
Used to destroy sessions

In your controller: $this->Session->destroy();



Généré le : Sun Feb 25 19:27:47 2007 par Balluche grâce à PHPXref 0.7