nextcloud-files
nextcloud-files copied to clipboard
fix!: Allow to inherit from `View` to create custom classes
Use case: You want to scope logic and state into the view rather than somewhere in a module.
Problems: Currently there are two problem that prevent creating a child-class of view:
- The view class did not implement the methods as methods but getters, this forces also child classes to use getters leading to really ugly code.
- The constructor required
getContents
to be part of theViewData
, but for child classes this makes no sense, as you probably want to overwrite this with a member function instead. Fixed by checking ifnew View
was called or a new subclass.