Download the PHP package blackfyre/json-ld without Composer
On this page you can find all versions of the php package blackfyre/json-ld. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download blackfyre/json-ld
More information about blackfyre/json-ld
Files in blackfyre/json-ld
Package json-ld
Short Description Extremely simple JSON-LD markup generator.
License BSD-2-Clause
Informations about the package json-ld
JSON-LD Generator
This a fork of Torann's JSON-LD generator, I've only extended it with missing things :smile:
Extremely simple JSON-LD generator.
Installation
From the command line run
Methods
/JsonLd/Context.php
create($context, array $data = [])
getProperties()
generate()
Context Types
- article
- beach
- blog_posting
- breadcrumb_list
- contact_point
- corporation
- creative_work
- duration
- event
- geo_coordinates
- image_object
- invoice
- job_posting
- list_item
- local_business
- music_album
- music_group
- music_playlist
- music_recording
- news_article
- offer
- order
- organization
- person
- place
- postal_address
- price_specification
- product
- rating
- review
- search_box
- thing
- video_object
- web_page
Examples
Quick Example
Business
News Article
Using the JSON-LD in a Laracasts Presenter
Even though this example shows using the JSON-LD inside of a Laracasts\Presenter
presenter, Laravel is not required for this package.
/App/Presenters/BusinessPresenter.php
Generate the Tags
The generator comes with a __toString
method that will automatically generate the correct script tags when displayed as a string.
Inside of a Laravel View
Inside of a Laravel View
Custom Context Type
The first argument for the create($context, array $data = [])
method also accepts class names. This is helpful for custom context types.
Change Log
See the releases section: https://github.com/blackfyre/json-ld/releases