apility/opengraph

OpenGraph helper class

v1.0.4 2019-11-13 10:32 UTC

This package is auto-updated.

Last update: 2024-10-13 23:27:48 UTC


README

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>