jdz/jsonld 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

jdz/jsonld

最新稳定版本:1.0.2

Composer 安装命令:

composer require jdz/jsonld

包简介

JDZ JSON LD content manager

关键字:

README 文档

README

Utilities to manage JSON-LD display.

Installation

To install the library, use Composer:

composer require jdz/jsonld

Usage

I'll add more examples soon .. including for nested elements

Blog Posting

<?php
try {
    $BlogPostingJsonLD = new \JDZ\JsonLd\BlogPostingEntity(true);
    $BlogPostingJsonLD->make(
        'https://localhost/blog/article/',
        'My Article',
        'My article short description',
        (new \DateTimeImmutable('2024-06-10 22:11:45'))->format(\DateTime::RFC3339),
        'https://localhost/image.jpg',
        'The Author',
        (new \DateTimeImmutable('2024-09-14 14:14:14'))->format(\DateTime::RFC3339),
        'The publisher'
    );
    $BlogPostingJsonLD->validate();

    echo 'BlogPostingJsonLD' . "\n";
    echo $BlogPostingJsonLD->export(true) . "\n\n";
} catch (\Throwable $e) {
    echo $e->getMessage();
}

Geo Coordinates

<?php
try {
    $GeoCoordinatesJsonLD = new \JDZ\JsonLd\GeoCoordinatesEntity(true);
    $GeoCoordinatesJsonLD->make('43.92370387039706', '1.781505605753222');
    $GeoCoordinatesJsonLD->validate();

    echo 'GeoCoordinatesJsonLD' . "\n";
    echo $GeoCoordinatesJsonLD->export(true) . "\n\n";
} catch (\Throwable $e) {
    echo $e->getMessage();
}

License

This project is licensed under the MIT License - see the LICENSE file for details.

Author

For more examples, see the examples directory.

统计信息

  • 总下载量: 7
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-07