\CachedFragment
Defines a section that can be written out to a cache, and be regenerated on demand, but will return a separate fragment if the system is currently in cache generation mode
- Author: <marcus@silverstripe.com.au>
- License: BSD License http://www.silverstripe.org/bsd-license
Synopsis
class CachedFragment
extends ViewableData
{
- // members
- public string $cacheName = '__OVERRIDE_THIS__';
- public SimpleCache $cache;
- private boolean $forceRegen = false;
- protected string $templateName = '';
- protected $context = NULL;
- // methods
- public void __construct()
- public void setForce()
- protected SimpleCache getCache()
- protected string getKey()
- protected void canGenerateCache()
- public void regenerate()
- public void forTemplate()
Hierarchy
Extends
- ViewableData
Members
private
- $forceRegen
—
boolean
Do we ignore the cache and just regenerate things regardless?
protected
- $context
- $templateName
public
- $cache — SimpleCache
- $cacheName
Methods
protected
- canGenerateCache() — Are we in a situation where cache generation is okay?
- getCache()
- getKey() — Get the key to use for this cached fragment