Skip to content

exinfinite/Jsonld

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jsonld

Packagist PHP Version Support GitHub release (latest SemVer) Packagist Version Packagist Downloads GitHub

安裝

composer require exinfinite/jsonld

使用

初始化

$jsonld = new Exinfinite\Jsonld("site name", "site url", "full url of site logo");
$jsonld->setTimezone("timezone");//default:"Asia/Taipei"

BreadcrumbList

$jsonld->breadcrumb([
    'page1_url' => 'page1_title',
    'page2_url' => 'page2_title',
    'page3_url' => 'page3_title',
    ...
]);

SearchAction

$jsonld->search("full path of search url", "query_param");

NewsArticle

$jsonld->article("page title", "page description", ["page thumbnail", "page thumbnail"], "page published date", "page modified date");

最終輸出

$jsonld->render();