setView($this->view); throw $e; } if (is_object($model) && (!$model instanceof Traversable) && method_exists($model, 'toArray') ) { $model = $model->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; } }