Neos\Fusion\Core\Cache\RuntimeContentCache::addTag PHP Метод

addTag() публичный Метод

Adds a tag built from the given key and value.
public addTag ( string $key, string $value ) : void
$key string
$value string
Результат void
    public function addTag($key, $value)
    {
        $key = trim($key);
        if ($key === '') {
            throw new Exception('Tag Key must not be empty', 1448264366);
        }
        $value = trim($value);
        if ($value === '') {
            throw new Exception('Tag Value must not be empty', 1448264367);
        }
        $tag = Functions::ucfirst($key) . 'DynamicTag_' . $value;
        $this->tags[$tag] = true;
    }

Usage Example

Пример #1
0
 /**
  * Add a tag to the current cache segment
  *
  * During TS rendering the method can be used to add tag dynamicaly for the current cache segment.
  *
  * @param string $key
  * @param string $value
  * @return void
  * @api
  */
 public function addCacheTag($key, $value)
 {
     if ($this->runtimeContentCache->getEnableContentCache() === false) {
         return;
     }
     $this->runtimeContentCache->addTag($key, $value);
 }