public function frontend()
{
if ($this->url) {
$config = $this->getOptions();
if (!isset($config["params"])) {
$config["params"] = [];
}
foreach (["width", "height"] as $property) {
if (isset($config[$property])) {
$config["params"][$property] = $config[$property];
}
}
$cacheKey = "doc_embed_" . crc32(serialize([$this->url, $config]));
if (!($html = \Pimcore\Cache::load($cacheKey))) {
$embera = new \Embera\Embera($config);
$html = $embera->autoEmbed($this->url);
\Pimcore\Cache::save($html, $cacheKey, ["embed"], 86400, 1, true);
}
return $html;
}
return "";
}