JsonLd::organization
サイトの会社や組織
説明
public static array JsonLd::organization( string $name [, string $url = '/' [, string $logo = '' [, array $sameAs = array() ] ] ] )
Organizationの項目を返します。$urlと$logoは絶対URLになります。$logoや$sameAsが空なら出力しません。
引数
| 名前 | データ型 | デフォルト | 備考 |
|---|---|---|---|
| $name | string | 会社や組織の名前 | |
| $url | string | '/' | そのサイトのパスまたはURL |
| $logo | string | '' | ロゴ画像のパスまたはURL |
| $sameAs | string[] | 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/"]
}