Message of the day:
Release 4.5.0 is out. Changelog: https://docs.silverstripe.org/en/4/changelogs/4.5.0
SilverStripe 4 related information and questions.
Right now it’s pre-caching an array copy of something before a
<% loop %> call.
However, it might be worth extending this to incorporate it into
<% if %> calls as well
and you're just being explicit about the data you're using across different domains of your app
template wouldnt auto-cache
so you can have the nice ORM + that deprecated cache
so the ORIGINAL idea, was if you're in a ->cache() DataList, it basically works like DataObject::get_one()
I’ve been working on something related to this here: https://github.com/silverstripe/silverstripe-framework/pull/6518
Yeah actually, the idea has changed in my head over time, and I didnt realize its just come back to this.
although, if we were to include this, I’d probably call it
toArrayList() rather than
i’m also wary of bloating the APIs with “hey maybe this’ll be good” kind of methods.