PHP code example of drnixx / yii2-schema-org

1. Go to this page and download the library: Download drnixx/yii2-schema-org library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

drnixx / yii2-schema-org example snippets


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

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


/* @var $this \yii\web\View */
/* @var $content string */
use app\widgets\Alert;
use yii\helpers\Html;
use yii\bootstrap\Nav;
use yii\bootstrap\NavBar;
use yii\widgets\Breadcrumbs;
use app\assets\AppAsset;
use drnixx\schemaorg\helpers\JsonLDHelper;
AppAsset::register($this);

use drnixx\schemaorg\models\Person;
use drnixx\schemaorg\helpers\JsonLDHelper;

$child = new Person();
$child->name = 'George W. Bush';
$child->disambiguatingDescription = '43rd President of the United States';
$person = new Person();
$person->name = 'George Bush';
$person->disambiguatingDescription = '41st President of the United States';
$person->children = [$child];

JsonLDHelper::add($person);

$ php composer.phar 

$ php yii schema/schema-org