PHP code example of fgh151 / yii2-opengraph

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

    

fgh151 / yii2-opengraph example snippets


'components' => [
   'opengraph' => [
       'class' => 'fgh151\opengraph\OpenGraph',
   ],
   //....
],

Yii::$app->opengraph->title = 'My post';
Yii::$app->opengraph->description = 'My post description';
Yii::$app->opengraph->image = 'http://site.ru/image.jpg';

php composer.phar