Pimcore\View\Helper\HeadScript::toString PHP Метод

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

Retrieve string representation
public toString ( string | integer $indent = null ) : string
$indent string | integer
Результат string
    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);
    }