metatag; $metaBaseInfo = Yii::$app->metabaseinfo; // $image = $metaBaseInfo->getBaseUrl() . '/' . $model->getImageLink(); $imagePath = $model->getImagePath(); $link = $model->getUrl(); if ($image === null) { $image = $metaBaseInfo->getBaseUrl() . '/images/blog-1.jpg'; $image = $imagePath; } list($width, $height, $type, $attr) = getimagesize($image); // $meta->set_image_url($image); $metaBaseInfoLogo = $metaBaseInfo->getSiteLogo(); try { list($widthl, $heightl, $typel, $attrl) = getimagesize($metaBaseInfoLogo); } catch (Exception $exception) { } ?> { "@context": "http://schema.org", "@type": "NewsArticle", "mainEntityOfPage": { "@type": "WebPage", "@id": "https://google.com/article" }, "headline": "", "image": { "@type": "ImageObject", "url": "", "height": "", "width": "" }, "datePublished": "getPublishedTimeISO() ?>", "dateModified": "getModifiedTimeISO() ?>", "author": { "@type": "Person", "name": "getByName('shop_name') ?>" }, "publisher": { "@type": "Organization", "name": "getByName('shop_name') ?>", "logo": { "@type": "ImageObject", "width": "", "height": "", "url": "" } }, "description": "" }