| 148 |
lars |
1 |
registerCacheResource()
|
|
|
2 |
|
|
|
3 |
dynamically register CacheResources
|
|
|
4 |
|
|
|
5 |
Description
|
|
|
6 |
===========
|
|
|
7 |
|
|
|
8 |
void
|
|
|
9 |
|
|
|
10 |
registerCacheResource
|
|
|
11 |
|
|
|
12 |
string
|
|
|
13 |
|
|
|
14 |
name
|
|
|
15 |
|
|
|
16 |
Smarty\_CacheResource
|
|
|
17 |
|
|
|
18 |
resource\_handler
|
|
|
19 |
|
|
|
20 |
Use this to dynamically register a [CacheResource
|
|
|
21 |
plugin](#caching.custom) with Smarty. Pass in the `name` of the
|
|
|
22 |
CacheResource and the object extending Smarty\_CacheResource. See
|
|
|
23 |
[Custom Cache Implementation](#caching.custom) for more information on
|
|
|
24 |
how to create custom CacheResources.
|
|
|
25 |
|
|
|
26 |
> **Note**
|
|
|
27 |
>
|
|
|
28 |
> In Smarty2 this used to be a callback function called
|
|
|
29 |
> `$cache_handler_func`. Smarty3 replaced this callback by the
|
|
|
30 |
> `Smarty_CacheResource` module.
|
|
|
31 |
|
|
|
32 |
|
|
|
33 |
<?php
|
|
|
34 |
$smarty->registerCacheResource('mysql', new Smarty_CacheResource_Mysql());
|
|
|
35 |
?>
|
|
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
See also [`unregisterCacheResource()`](#api.unregister.cacheresource)
|
|
|
40 |
and the [Custom CacheResource Implementation](#caching.custom) section.
|