<?php class ErrorListViewHelper extends ViewHelper implements ViewHelperInterface { public function objectToArray(mixed $object): array { if (get_class($object) !== 'ErrorList') { throw new Exception('Этот метод принимает только объекты класса ErrorList.'); } $listFields = $this->getListFields($object); $result = []; foreach ($listFields as $field) { $valueField = implode(" ", $object->getListOfFieldErrors($field)); $valueField = $this->escapeMetacharacters($valueField); $result = $valueField; } } }
You have javascript disabled. You will not be able to edit any code.