public function transformReadonly(FieldList $fields)
    {
        foreach ($fields->dataFields() as $field) {
            if ($field instanceof HiddenField) {
                continue;
            }
            $newField = $field->castedCopy(HTMLReadonlyField::class);
            $fields->replaceField($field->getName(), $newField);
        }
        return $fields;
    }
public function transformReadonly(FieldList $fields)
    {
        foreach ($fields->dataFields() as $field) {
            if ($field instanceof HiddenField) {
                continue;
            }
            $newField = $field->castedCopy(HTMLReadonlyField::class);
            $fields->replaceField($field->getName(), $newField);
        }
        return $fields;
    }
public function transformReadonly ( FieldList $ fields ) { foreach ( $ fields -> dataFields ( ) as $ field ) { if ( $ field instanceof HiddenField ) { continue ; } $ newField = $ field -> castedCopy ( HTMLReadonlyField :: class ) ; $ fields -> replaceField ( $ field -> getName ( ) , $ newField ) ; } return $ fields ; }
Replace all data fields with HTML readonly fields to display diff

@param FieldList $fields
@return FieldList
Replace all data fields with HTML readonly fields to display diff