Download the PHP package secit-pl/schema-org without Composer
On this page you can find all versions of the php package secit-pl/schema-org. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download secit-pl/schema-org
More information about secit-pl/schema-org
Files in secit-pl/schema-org
Package schema-org
Short Description Schema.org classes.
License MIT
Homepage http://secit.pl
Informations about the package schema-org
Schema.org class mapping
A class mapping for the schema.org data types, types and properties.
BC break warning
From release 3.3.2 all properties should be suffixed by the word Property and all types should be suffixed by the word Type. All properties without Property suffix and and all types without Type suffix are now marked as deprecated. This change is required to support PHP 7.x which have a few new restricted words which cannot be used as a class names.
Please change your code and add the suffix to use the new naming schema.
All deprecated (non suffixed) classes will be removed in release 3.4.
Installation
From the command line run
Usage
First create the data structure:
Now you can convert it to the JSON-LD string as following
The output should be a valid schema.org JSON-LD:
If you'd like to check the output validation you can use the tool provided by Google: https://search.google.com/structured-data/testing-tool
Code examples
Breadcrumbs
The output:
Product
The output:
Project tags
As you maybe noticed the bundle don't use the standard tag numeration flow. Each two first parts of the tag corresponds to the version of the schema from schema.org from which the mapping classed were generated.
The schema.org releases history can be found here: https://schema.org/docs/releases.html