Doc update - add FQCN to example code

Add fully qualified classname to aggregate caching example
This commit is contained in:
DorsetDigital 2018-09-27 10:21:01 +01:00 committed by GitHub
parent 2f67be61c1
commit da38505446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,13 +63,13 @@ otherwise. By using aggregates, we do that like this:
```ss
<% cached 'navigation', $List('SiteTree').max('LastEdited'), $List('SiteTree').count() %>
<% cached 'navigation', $List('SilverStripe\CMS\Model\SiteTree').max('LastEdited'), $List('SilverStripe\CMS\Model\SiteTree').count() %>
```
The cache for this will update whenever a page is added, removed or edited.
The cache for this will update whenever a page is added, removed or edited. (Note: The use of the fully qualified classname is necessary).
If we have a block that shows a list of categories, we can make sure the cache updates every time a category is added
or edited
or edited:
```ss