[TYPO3-ect] smartyView with div/lib
Steffen Kamper
steffen at dislabs.de
Sun Jan 14 00:26:53 CET 2007
"Elmar HInz" <elmar.DOT.hinz at team.MINUS.red.DOT.net> schrieb im Newsbeitrag
news:mailman.1.1168728218.1525.typo3-team-extension-coordination at lists.netfielders.de...
> Hi Steffen,
>
>> $this->set(name,value);
>> $this->get(name);
>>
>> but how can walk through this array like foreach($array as $var=>$val) ?
>>
>
> in PHP5 you simply do: foreach($this as $key => $value){ ... }
>
> Yes, iterating an object, that's the SPL magic. But I haven't proved that
> cause I try to keep it PHP 4 compatible.
>
> The PHP 4 compatible version is:
>
> for($this->rewind(); $this->valid(); $this->next()) {
> $key = $this->key();
> $value = $this->current();
> ...
> }
>
> That's the way you will find it in my examples.
>
> To iterarte the object from external replace $this with the variable
> name of the object i.e. $myList.
>
> Regards
>
> Elmar
>
Hi Elmar,
ah - thx.I will try this way.
I saw that you did it in loopToObjectList ;-)
would it be helpful if tx_lib_data would have the function getArrayCopy()
as well ? so it would be possible to iterate.
May be a function getArrayReference as well.
vg Steffen
More information about the TYPO3-team-extension-coordination
mailing list