apility/opengraph

OpenGraph helper class


License
Beerware

Documentation

OpenGraph

OpenGraph is a helper class for generating Open Graph meta tags.

License: Beerware Version CircleCI

Documentation

Installation

Use the package manager Composer to install OpenGraph.

composer require apility/opengraph

Usage

use Apility\OpenGraph\OpenGraph;

$og = new OpenGraph;
$og->addProperty('title', 'Hello World');
?>
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <?php print($og->toMetaTags()); ?>
  <title>Document</title>
</head>
<body>
  <h1>Hello World</h1>
</body>
</html>