PHP Classes

File: htdocs/xoops_lib/vendor/smarty/smarty/docs/programmers/api-functions/api-register-cacheresource.md

Recommend this page to a friend!
  Packages of Michael Beck   Xoops 2.5   htdocs/xoops_lib/vendor/smarty/smarty/docs/programmers/api-functions/api-register-cacheresource.md   Download  
File: htdocs/xoops_lib/vendor/smarty/smarty/docs/programmers/api-functions/api-register-cacheresource.md
Role: Example script
Content type: text/markdown
Description: Example script
Class: Xoops 2.5
Modular content management publication system
Author: By
Last change:
Date: 2 months ago
Size: 876 bytes
 

Contents

Class file image Download

registerCacheResource()

dynamically register CacheResources

Description

void

registerCacheResource

string

name

Smarty\_CacheResource

resource\_handler

Use this to dynamically register a CacheResource plugin with Smarty. Pass in the name of the CacheResource and the object extending Smarty\_CacheResource. See Custom Cache Implementation for more information on how to create custom CacheResources.

> Note > > In Smarty2 this used to be a callback function called > $cache_handler_func. Smarty3 replaced this callback by the > Smarty_CacheResource module.

<?php
$smarty->registerCacheResource('mysql', new Smarty_CacheResource_Mysql());
?>

   

See also unregisterCacheResource() and the Custom CacheResource Implementation section.