Skip to main content
Version: Fegg 5.x

JsonLd::organization

The company or organization of the site

Description​

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

Returns an Organization item. $url and $logo become absolute URLs; an empty $logo or $sameAs is left out.

Arguments​

NameData typeDefaultRemarks
$namestringName of the company or organization
$urlstring'/'Path or URL of its site
$logostring''Path or URL of the logo image
$sameAsstring[]array()URLs of its other profiles (social accounts)

Example​

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/"]
}