メインコンテンツまでスキップ
Version: Fegg 5.x

JsonLd::organization

サイトの会社や組織

説明​

public static array JsonLd::organization( string $name [, string $url = '/' [, string $logo = '' [, array $sameAs = array() ] ] ] )

Organizationの項目を返します。$urlと$logoは絶対URLになります。$logoや$sameAsが空なら出力しません。

引数​

名前データ型デフォルト備考
$namestring会社や組織の名前
$urlstring'/'そのサイトのパスまたはURL
$logostring''ロゴ画像のパスまたはURL
$sameAsstring[]array()ほかのプロフィール(SNSアカウント)のURL

例​

Controller
use Fegg\Tool\JsonLd;

JsonLd::organization('Example Inc.', '/', '/data/img/common/logo.png', array(
'https://www.instagram.com/example/',
));
Output
{
"@context": "https://schema.org",
"@type": "Organization",
"name": "Example Inc.",
"url": "https://www.example.com/",
"logo": "https://www.example.com/data/img/common/logo.png",
"sameAs": ["https://www.instagram.com/example/"]
}