xPDOCacheManager.get
Last updated Apr 6th, 2019 | Page history | Improve this page | Report an issue
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$306 per month—let's make that $500!
Learn morexPDOCacheManager::get¶
Get a value from a cache provider by key.
Also allows for an array of options to be passed. The current available values are:
-
format
- If equalsXPDO_CACHE_JSON
, will simply get the contents of the array. This is useful if youset()
the cache withXPDO_CACHE_JSON
, to better handle JSON data. -
removeIfEmpty
- If set to true, will remove the cache file if it's empty. This is the default action.
Syntax¶
API Docs: http://api.modxcms.com/xpdo/cache/xPDOCacheManager.html#get
mixed get (string $key, [array $options = array()])
Example¶
Get the cache record 'test' into a string:
$test = $xpdo->cacheManager->get('test');
Get our JSON cache data called 'myjson':
$myJsonData = $xpdo->cacheManager->get('myjson',array('format' => xPDO::CACHE_JSON));
See Also¶
- xPDOCacheManager.copyFile
- xPDOCacheManager.copyTree
- xPDOCacheManager.delete
- xPDOCacheManager.deleteTree
- xPDOCacheManager.endsWith
- xPDOCacheManager.escapeSingleQuotes
- xPDOCacheManager.get
- xPDOCacheManager.getCachePath
- xPDOCacheManager.getCacheProvider
- xPDOCacheManager.matches
- xPDOCacheManager.replace
- xPDOCacheManager.writeFile
- xPDOCacheManager.set
- xPDOCacheManager.writeTree
- xPDOCacheManager
Support the team building MODX with a monthly donation.
The budget raised through OpenCollective is transparent, including payouts, and any contributor can apply to be paid for their work on MODX.
Backers
Budget
$306 per month—let's make that $500!
Learn more