public function toString($indent = null)
{
foreach ($this as &$item) {
if (!$this->_isValid($item)) {
continue;
}
if ($this->isCacheBuster()) {
// adds the automatic cache buster functionality
if (is_array($item->attributes)) {
if (isset($item->attributes["src"])) {
$realFile = PIMCORE_DOCUMENT_ROOT . $item->attributes["src"];
if (file_exists($realFile)) {
$item->attributes["src"] = "/cache-buster-" . filemtime($realFile) . $item->attributes["src"];
}
}
}
}
\Pimcore::getEventManager()->trigger("frontend.view.helper.head-script", $this, ["item" => $item]);
}
return parent::toString($indent);
}