Pimcore\Tool\Text::getCacheTagsOfWysiwygText PHP Метод

getCacheTagsOfWysiwygText() публичный статический Метод

public static getCacheTagsOfWysiwygText ( $text, array $tags = [] ) : array
$text
$tags array
Результат array
    public static function getCacheTagsOfWysiwygText($text, $tags = [])
    {
        $tags = is_array($tags) ? $tags : [];
        if (!empty($text)) {
            $elements = self::getElementsInWysiwyg($text);
            foreach ($elements as $element) {
                $el = $element["element"];
                if (!array_key_exists($el->getCacheTag(), $tags)) {
                    $tags = $el->getCacheTags($tags);
                }
            }
        }
        return $tags;
    }

Usage Example

Пример #1
0
 /**
  * This is a dummy and is mostly implemented by relation types
  *
  * @param mixed $data
  * @param array $tags
  * @return array
  */
 public function getCacheTags($data, $tags = array())
 {
     return Text::getCacheTagsOfWysiwygText($data, $tags);
 }
All Usage Examples Of Pimcore\Tool\Text::getCacheTagsOfWysiwygText