silverstripe / silverstripe-cms

Silverstripe CMS - this is a module for Silverstripe Framework rather than a standalone app. Use https://github.com/silverstripe/silverstripe-installer/ to set this up.
http://silverstripe.org/
BSD 3-Clause "New" or "Revised" License
512 stars 331 forks source link

Refactor `ModelAsController` to be generic #2952

Open GuySartorelli opened 3 months ago

GuySartorelli commented 3 months ago

ModelAsController is currently hardcoded to work with SiteTree. It's not uncommon to want to route to a DataObject that isn't managed in the site tree, and therefore isn't a SiteTree object - but for the frontend to treat it the same way it treats SiteTree objects.

Making this class more generic removes some friction from that use case.

Acceptance Criteria

TO DECIDE

Arguably this doesn't open much opportunity if we don't move some stuff around as well - but what should we move, and to where?