[Phplib-users] how to save array pointer with phplib
Brought to you by:
nhruby,
richardarcher
|
From: Marko K. <Mar...@mc...> - 2002-02-08 10:28:02
|
Hi,
I tried to save an array inside a class which should be able to save its
variables using phplib. As persistent slot I took the array "list" as
shown in the snip-out of my code below.
The problem is that the list certainly gets properly saved, but the
pointer got lost... Though the class gets saved after reloading its state
with a new page changes made to the current position in the array are
forgotten. I mean, if I cycled with next() and prev() through the array
"list" I always start at the first entry the class got reloaded... Too
sad.
Does anybody know how to save the pointer to the current element?
Looks like one needs to get the current position inside the array and then
to treat this as a seperate entry in the "persistent_slots"!
Any comments are welcome. Maybe I ve overseen something, but maybe this is
a principle problem for phplib, being unable to save the actual state of
an array object.
Thanks in advance,
Marko
-- SNIP ---
class StepItClass
{
var $classname= 'StepItClass';
var $persistent_slots = array(
'list'
);
#------------------------------------------------------------
# persistent variables:
var $list=array();
...
|