Skip to content

fgh151/yii2-opengraph

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Open graph tags

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';

About

Module add opengraph tags to yii2 project

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages