Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

lengthofrope/create-jsonld-tiny

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

create-jsonld-tiny Build Status Codacy Badge

Simple PHP library to create JSON-LD output. Tiny version!

Note: Datatypes are not yet supported

This is the TINY VERSION of the class, mainly there for the following schema's:

  • Article,
  • BlogPosting,
  • Book,
  • Code,
  • Game,
  • Movie,
  • MusicRecording,
  • Painting,
  • Photograph,
  • Recipe,
  • Organization,
  • Corporation,
  • LocalBusiness,
  • SportsOrganization,

Usage:

use \LengthOfRope\JSONLD;
use \LengthOfRope\JSONLD\Schema;

$Create = JSONLD\Create::factory()->add(
    Schema\BookSchema::factory()
        ->setAuthor(Schema\PersonSchema::factory()->setName("NAME")->setEmail("[email protected]"))
        ->setAbout("PHP")
        ->setName("Superb PHP Book")
        ->setAlternateName("Book one of three")
)->add(
    Schema\OrganizationSchema::factory()
        ->setAddress(
            Schema\PostalAddressSchema::factory()
                ->setPostalCode("1234 AA")
                ->setStreetAddress("Somewhere 12")
                ->setAddressCountry("NL")
                ->setAddressLocality("Amersfoort")
                ->setEmail("[email protected]")
                ->setTelephone("033-1234567")
                ->setAddressRegion("Utrecht")
        )
        ->setName("Devver Company")
        ->setDescription("Just another developer")
);

echo $Create->getJSONLDScript();

About

Trimmed down version of create-jsonld

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages