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/

Reply via email to