Good Evening!
I want to create a basket for a simple shop. The chosen product
should be stored into a session-variable until the checkout procedure.
I am asking if it (and how!) it is possible to store an array in a
cake-session?
As an Example: the user puts the first object into his basket:
// get the current basket
$basket = $this-Session-read('basket');
if ( empty($basket) ){
$basket = array();
}
// modify it how you like
$basket[] = $new_product;
// save back to session
$this-Session-write( 'basket', $basket );
On Nov 26, 8:08 am, ohneworte [EMAIL PROTECTED] wrote:
Good
If you want to add to the array without using a key you can use:
$this-Session-write('myarray\'][][\'', 'myvalue' );
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email
In the views , you may use $this-controller-Session-read('Transaccion');
spark
On 6/10/06, Carlos Mauricio Samour [EMAIL PROTECTED] wrote:
Well I just answered my own question by doing this:
$this-set('data', $this-Session-read('Transaccion'));
Once againg:
CAKE RULES!
On 6/10/06,
Well I just answered my own question by doing this:
$this-set('data', $this-Session-read('Transaccion'));
Once againg:
CAKE RULES!
On 6/10/06, Carlos Mauricio Samour [EMAIL PROTECTED] wrote:
On the wiki I read that if you wanted to save an array with the
session component you do this: