exinfinite / jsonld
render jsonld
1.1.0
2021-01-15 07:07 UTC
Requires
- php: >=5.6
This package is auto-updated.
Last update: 2025-03-15 16:19:37 UTC
README
安裝
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();