Thanks Michael,
What I'm trying to get is a nested foreach LOOP. My work around does not do
it. I'll play with yours and see if I can get it to loop.
Thanks,
Michael B Allen-3 wrote:
>
> On 10/8/07, Waigani <[EMAIL PROTECTED]> wrote:
>> > can you nest foreach in the framework?
>> >
>> > eg in a view template:
>> >
>> > foreach($this->many as $one){
>> > print_r($one);
>> > foreach($this->many as $one){
>> > print_r($one);
>> > }
>> > }
>
> Hi Waigani,
>
> Each iterator is specific to the object being operated on so just make
> a copy of the array before you iterate over it. Also, you'll have to
> use a separate variable for $one if it will be used in the outer loop.
>
> Try this:
>
> foreach ($this->many as $one) {
> $_many = $this->many;
> foreach ($_many as $_one) {
> print_r($_one);
> }
> }
>
> --
> Michael B Allen
> PHP Active Directory SPNEGO SSO
> http://www.ioplex.com/
>
>
--
View this message in context:
http://www.nabble.com/nested-foreach-tf4591373s16154.html#a13108024
Sent from the Zend Framework mailing list archive at Nabble.com.