PHP code example of simialbi / yii2-schema-org

1. Go to this page and download the library: Download simialbi/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/ */

    

simialbi / yii2-schema-org example snippets


'modules' => [
	'schema' => [
		'class' => 'simialbi\yii2\schemaorg\Module',
		//'autoCreate' => false,
		//'autoRender' => false
	]
]

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


/* @var $this \yii\web\View */
/* @var $content string */
use yii\helpers\Html;
use app\assets\AppAsset;
use simialbi\yii2\schemaorg\helpers\JsonLDHelper;

AppAsset::register($this);

use simialbi\yii2\schemaorg\helpers\JsonLDHelper;
use simialbi\yii2\schemaorg\models\Person;

$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);
bash
$ php composer.phar 
bash
$ php yii schema/models/generate