PHPackages                             beyerz/open-graph-protocol-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. beyerz/open-graph-protocol-bundle

ActiveSymfony-bundle[Utility &amp; Helpers](/categories/utility)

beyerz/open-graph-protocol-bundle
=================================

Integration for OpenGraph protocol and Symfony2

2.0.0(9y ago)36.4k↓100%4[5 issues](https://github.com/beyerz/OpenGraphProtocolBundle/issues)MITPHPPHP &gt;=5.5

Since Oct 15Pushed 9y ago2 watchersCompare

[ Source](https://github.com/beyerz/OpenGraphProtocolBundle)[ Packagist](https://packagist.org/packages/beyerz/open-graph-protocol-bundle)[ RSS](/packages/beyerz-open-graph-protocol-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (4)Used By (0)

[![Packagist](https://camo.githubusercontent.com/90ece00d8a9035fc21badf2988e40992ecf3086c1c97a7966754777ebdb86b7c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62657965727a2f6f70656e2d67726170682d70726f746f636f6c2d62756e646c652e737667)](https://packagist.org/packages/beyerz/open-graph-protocol-bundle)[![Minimum PHP Version](https://camo.githubusercontent.com/86e7d829a466cacd5658a22073e27d49d39dac72cc18216ac4963ed5463c5bbc/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344253230352e362d3838393242462e7376673f7374796c653d666c61742d737175617265)](https://php.net/)[![Build Status](https://camo.githubusercontent.com/9171ad6407ec1f7d330f1142e35e52d5ab89932e299077cf143ff321d3c58ee7/68747470733a2f2f7472617669732d63692e6f72672f62657965727a2f4f70656e477261706850726f746f636f6c42756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/beyerz/OpenGraphProtocolBundle)

OpenGraphProtocolBundle
=======================

[](#opengraphprotocolbundle)

Easy Integration for Symfony2 projects requiring opengraph

The OpenGraphBundle enables easy integration for Symfony2 and twig views to incorporate the Open Graph Protocols

**Important Note: If you are using symfony version less than 2.8, please stay with build v1.0 as v2.0 may not work correctly due to symfony using traits for container awareness**

Installation
============

[](#installation)

### Composer

[](#composer)

```
composer require beyerz/open-graph-protocol-bundle
```

### Application Kernel

[](#application-kernel)

Add OpenGraphBundle to the `registerBundles()` method of your application kernel:

```
public function registerBundles()
{
    return array(
        new Beyerz\OpenGraphProtocolBundle\OpenGraphProtocolBundle(),
    );
}
```

### Config

[](#config)

Enable loading of the OGP service and setting default values by adding the following to the application's `config.yml` file:

A Base and facebook library are currently supported, but you can add as many libraries with as many default values that you like

```
#OGP Bundle
open_graph_protocol:
    libraries:
        base:
            class: Beyerz\OpenGraphProtocolBundle\Libraries\Base
            default_values:
                site_name: {{ default value for website name }}
                type: {{ default value for website type }}
                title: {{ default value for any page title }}
                url: {{ default value for any canonical url (acts as a fall back for bad pages) }}
                image: {{ default image for your site }}
                description: {{ default generic page description for your site }}
        facebook:
            class: Beyerz\OpenGraphProtocolBundle\Libraries\Facebook
            default_values: { app_id: {{ Your apps facebook id }} }
```

Documentation
=============

[](#documentation)

### View

[](#view)

Include the OGP Metas in the `head` tag of your layout.

With twig:

```
{% block metas %}
        {{ ogp()|raw }}
{% endblock %}

```

### Overriding Meta Values

[](#overriding-meta-values)

Its common that you would want to change meta values like title, image, description etc... This is easily done from within your page page controller (or any where that has access to the service container)

**From your Controller**

```
$ogp = $this->get('beyerz.ogp.open_graph');
$base = $ogp->get('base');
$base->addMeta('title', "My dynamic title");
$base->addMeta('url', $request->getSchemeAndHttpHost().$request->getRequestUri());
$base->addMeta('description', "My dynamic description");

```

### Testing Tools

[](#testing-tools)

Facebook

-

Twitter

-

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance0

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 97.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~798 days

Total

2

Last Release

3426d ago

Major Versions

v1.0 → 2.0.02016-12-22

PHP version history (2 changes)v1.0PHP &gt;=5.3.0

2.0.0PHP &gt;=5.5

### Community

Maintainers

![](https://www.gravatar.com/avatar/3812d8934a9934b62846482516124b3cd6c95a1e7457d9f693ddd0fefd9b79dd?d=identicon)[beyerz](/maintainers/beyerz)

---

Top Contributors

[![beyerz](https://avatars.githubusercontent.com/u/4946849?v=4)](https://github.com/beyerz "beyerz (37 commits)")[![janit](https://avatars.githubusercontent.com/u/198965?v=4)](https://github.com/janit "janit (1 commits)")

---

Tags

symfonySymfony2opengraphfacebook-graphogOpenGraph Protocolopen-graph-protocol

### Embed Badge

![Health badge](/badges/beyerz-open-graph-protocol-bundle/health.svg)

```
[![Health](https://phpackages.com/badges/beyerz-open-graph-protocol-bundle/health.svg)](https://phpackages.com/packages/beyerz-open-graph-protocol-bundle)
```

###  Alternatives

[aws/aws-sdk-php-symfony

A Symfony bundle for v3 of the AWS SDK for PHP

36517.7M22](/packages/aws-aws-sdk-php-symfony)[maba/webpack-bundle

Bundle to Integrate Webpack to Symfony

123268.2k4](/packages/maba-webpack-bundle)[blackknight467/star-rating-bundle

Star Rating Bundle for use with Symfony 2 using Font Awesome. This bundle adds the 'rating' form type and rating filter to render ratings. Simple and easy to use.

27198.0k](/packages/blackknight467-star-rating-bundle)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
