session array variable fatfree -


i playing own way of storing user selected items on simple shop system uses hidden int values( primary id item) form.
on each selection test see if session variable has been set if not:

 if ($f3->get('session.item') == null)          {         $f3->set('session.item',array($itemfrompost ));                 ... } 

if has been set push next selection :

$f3->push('session.item',$itemfrompost); 

it promising , can count of items like:

$total = (count ( $f3->get('session.item') 

also can this:

echo $f3->get('session.item[0]'); 

what doesn't work when want run through items:

for ($i= 0; $i <= totalcountvalueminus1; $i++ )     {     echo $f3->get('session.item[$i]');     } 

how do this?


Comments

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -