CakePHP 1.3清除单个视图的缓存

时间:2013-03-08 10:34:46

标签: cakephp caching view

在控制器中我可以使用clearCache();但它会删除整个/ cache / views /目录。有没有办法只删除当前的pageid缓存? 谢谢!

1 个答案:

答案 0 :(得分:1)

您应该阅读上面的docblock /文档

function clearCache($params = null, $type = 'views', $ext = '.php') {}

它表示$ params:

@param string|array $params As String name to be searched for deletion, if name is a directory all files in
 *   directory will be deleted. If array, names to be searched for deletion. If clearCache() without params,
 *   all files in app/tmp/cache/views will be deleted