PHPackages                             drnixx/yii2-schema-org - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. drnixx/yii2-schema-org

ActiveYii2-extension

drnixx/yii2-schema-org
======================

Schema.org yii2 representation and helpers for json-ld generation in Yii framework

1.5.3(7y ago)1106MITPHPPHP &gt;=5.6.0

Since Aug 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/DrNixx/yii2-schema-org)[ Packagist](https://packagist.org/packages/drnixx/yii2-schema-org)[ RSS](/packages/drnixx-yii2-schema-org/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (1)Versions (14)Used By (0)

yii2-schema-org
===============

[](#yii2-schema-org)

Schema.org yii2 representation and helpers for json-ld generation

Resources
---------

[](#resources)

- JSON-LD [documentation](http://json-ld.org/learn.html)
- Google [Structured Data Testing Tool](https://search.google.com/structured-data/testing-tool)

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
$ php composer.phar require --prefer-dist drnixx/yii2-schema-org

```

or add

```
"drnixx/yii2-schema-org": "*"

```

to the `require` section of your `composer.json`

Usage
-----

[](#usage)

### Setup Module

[](#setup-module)

Configure the module named `schema` in the modules section of your Yii configuration file. Do this for console and for web application configuration file.

```
'modules' => [
	'schema' => [
		'class' => 'drnixx\schemaorg\Module',
		//'source' => 'http://schema.org/docs/full.html',
		//'autoCreate' => false,
		//'autoRender' => false
	]
]
```

Also add the module `schema` to the bootstrap section of your configuration files:

```
'bootstrap' => ['log', 'schema']
```

### Configuration

[](#configuration)

#### source

[](#source)

The `source` parameter defines the root url of [schema.org](http://schema.org) property documentation. It is used to automatically create the models in console application.

#### autoCreate

[](#autocreate)

Automatically create breadcrumbs `json+ld` data.

#### autoRender

[](#autorender)

Automatically render `json+ld` data at the end of body section.

If you don't use this parameter, be sure to call `JsonLDHelper::render()` in your layout file. Example:

```
