toArray(); } $content = ''; // reset the counter if it's call again $this->partialCounter = 0; foreach ($model as $item) { // increment the counter variable $this->partialCounter++; $content .= $this->partial($name, $module, $item); } return $content; } }