This is a simple PHP library which help to interact with Open Graph Protocol and Twitter Card

1.0.0 2021-02-04 22:25 UTC

This package is auto-updated.

Last update: 2022-11-21 21:48:41 UTC



CircleCI StyleCI Total Downloads Latest Stable Version License: MIT

PHP Open Graph library

This is a library to help you configure and render Open Graph Protocol and Twitter Cards for your website.


The package could be installed with composer:

composer require vumanskyi/php-open-graph-library


use VU\OpenGraph\Render;
use VU\OpenGraph\PropertyConfiguration;
use VU\OpenGraph\Properties\Basic;

$render = new Render();
$configuration = new PropertyConfiguration($render);

$basic = new Basic($configuration);
$basic->setTitle('Test title')
    ->setDescription('Test description')

echo $basic->render();

And the result will be:

<meta property="og:title" content="Test title">
<meta property="og:description" content="Test description">
<meta property="og:locale" content="uk_UA">

Another types:

  • \VU\OpenGraph\Properties\Articles
  • \VU\OpenGraph\Properties\Audio
  • \VU\OpenGraph\Properties\Basic
  • \VU\OpenGraph\Properties\Book
  • \VU\OpenGraph\Properties\Image
  • \VU\OpenGraph\Properties\Profile
  • \VU\OpenGraph\Properties\Video
  • \VU\OpenGraph\Properties\TwitterCard

Unit testing


If you have any issues, please let me know