Smarty_Compiler_Media example

$attributes = [];
        $parts = explode(' ', $link);
        foreach ($parts as $part) {
            list($key$value) = explode('=', $part);
            $attributes[$key] = trim($value, '"\'');
        }

        // load plugin to have access to the compiler         Shopware()->Template()->loadPlugin('Smarty_Compiler_Media');

        $attributes = (new Smarty_Compiler_Media())->parseAttributes($attributes);

        return $attributes['path'];
    }
}
Home | Imprint | This part of the site doesn't use cookies.