mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2025-01-31 09:06:17 +00:00
Refactoring to remove some duplication.
This commit is contained in:
parent
1cf5e72054
commit
7ad4068085
1 changed files with 6 additions and 7 deletions
|
@ -334,18 +334,17 @@ class View extends Object {
|
|||
}
|
||||
|
||||
if (isset($params['cache'])) {
|
||||
$keys = array_merge(array($plugin, $name), array_keys($params));
|
||||
$caching = array(
|
||||
'config' => $this->elementCache,
|
||||
'key' => implode('_', $keys)
|
||||
);
|
||||
if (is_array($params['cache'])) {
|
||||
$defaults = array(
|
||||
'config' => $this->elementCache,
|
||||
'key' => $plugin . '_' . $name,
|
||||
'key' => $caching['key']
|
||||
);
|
||||
$caching = array_merge($defaults, $params['cache']);
|
||||
} else {
|
||||
$keys = array_merge(array($plugin, $name), array_keys($params));
|
||||
$caching = array(
|
||||
'config' => $this->elementCache,
|
||||
'key' => implode('_', $keys)
|
||||
);
|
||||
}
|
||||
$key = 'element_' . $caching['key'];
|
||||
$contents = Cache::read($key, $caching['config']);
|
||||
|
|
Loading…
Add table
Reference in a new issue