fgh151/yii2-opengraph

Add open graph tags

Installs: 559

Dependents: 0

Suggesters: 0

Stars: 1

Watchers: 3

Forks: 1

Open Issues: 0

Type:yii2-extension

v0.0.1 2017-02-16 14:59 UTC

README

Add open graph tags

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist fgh151/yii2-opengraph "*"

or add

"fgh151/yii2-opengraph": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, add it to component config :

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

Then in controller or view set og tags

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