PHPackages                             gourmet/social-meta - 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. [API Development](/categories/api)
4. /
5. gourmet/social-meta

ActiveCakephp-plugin[API Development](/categories/api)

gourmet/social-meta
===================

Adds Facebook Open Graph and Twitter Cards support to CakePHP 3.x

v1.0.2(9y ago)255.1k8[2 issues](https://github.com/gourmet/social-meta/issues)MITPHP

Since Mar 27Pushed 9y ago6 watchersCompare

[ Source](https://github.com/gourmet/social-meta)[ Packagist](https://packagist.org/packages/gourmet/social-meta)[ Docs](https://github.com/gourmet/social-meta)[ RSS](/packages/gourmet-social-meta/feed)WikiDiscussions master Synced 1mo ago

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

Social Meta
===========

[](#social-meta)

[![Build Status](https://camo.githubusercontent.com/0b14e50450fb0b927560caed460de0e3969a927d10dbf77a38fe2e28a14f48af/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f676f75726d65742f736f6369616c2d6d6574612f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/gourmet/social-meta)[![Total Downloads](https://camo.githubusercontent.com/796c4318d33bfbe9e55fbb6ecbd5f303ca801530e988b45d0ade5a6fd27ee088/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f676f75726d65742f736f6369616c2d6d6574612e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/gourmet/social-meta)[![License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](LICENSE.txt)

Adds [Facebook Open Graph](https://developers.facebook.com/docs/opengraph) and [Twitter Cards](https://dev.twitter.com/cards/overview) support to [CakePHP 3](http://cakephp.org).

What's included?
----------------

[](#whats-included)

- CardHelper
- OpenGraphHelper

Install
-------

[](#install)

Using [Composer](http://getcomposer.org):

```
composer require gourmet/social-meta:~1.0

```

You then need to load the plugin. In `boostrap.php`, something like:

```
\Cake\Core\Plugin::load('Gourmet/SocialMeta');
```

Usage
-----

[](#usage)

Include the helpers in your `AppView`:

```
public function initialize(array $config)
{
    $this->loadHelper('Gourmet/SocialMeta.Card');
    $this->loadHelper('Gourmet/SocialMeta.OpenGraph');
}
```

Keep in mind that certain configuration option are made available to you. For example:

```
public function initialize(array $config)
{
    $this->loadHelper('Gourmet/SocialMeta.Card', [
        'card' => 'photo',
        'tags' => ['twitter' => [
            'description' => 'Some default description'
        ]]
    ]);
    $this->loadHelper('Gourmet/SocialMeta.OpenGraph', [
        'app_id' => 'xxx'
    ]);
}
```

You are now ready to use the helpers in your view / layout.

For the [Facebook OpenGraph](https://developers.facebook.com/docs/opengraph), you will need to use the helper's `html()` method as it will include the defined namespaces:

```
echo $this->OpenGraph->html();
```

or by passing extra options and namespaces:

```
echo $this->OpenGraph->html(['lang' => 'en'], ['foo' => 'http://foo']);
```

You can then render the OpenGraph meta tags:

```
echo $this->OpenGraph->render();
```

which will render the most basic stuff using some black magic, or you could be much more verbose:

```
echo $this->OpenGraph
    ->setTitle('My Page')
    ->setDescription('One of my awesome pages')
    ->setImage('http://link.to/image', ['width' => '200', 'height' => '300'])
    ->render();
```

Other methods: `setType`, `setUri`, `setLocale`, `setName`, `setImage`, `setVideo`

For the [Twitter Cards](https://dev.twitter.com/cards/overview), something similar to that last code example:

```
echo $this->Card
    ->setTitle('My Page')
    ->setDescription('One of my awesome pages')
    ->setImage('http://link.to/image', ['width' => '200', 'height' => '300'])
    ->render();
```

Other methods: `setCard`, `setUrl`, `setData1`, `setLabel1`, `setData2`, `setLabel2`, `setCreator`, `setSite`, `setPlayer`

Patches &amp; Features
----------------------

[](#patches--features)

- Fork
- Mod, fix
- Test - this is important, so it's not unintentionally broken
- Commit - do not mess with license, todo, version, etc. (if you do change any, bump them into commits of their own that I can ignore when I pull)
- Pull request - bonus point for topic branches

Bugs &amp; Feedback
-------------------

[](#bugs--feedback)

License
-------

[](#license)

Copyright (c)2015, Jad Bitar and licensed under [The MIT License](http://www.opensource.org/licenses/mit-license.php).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity32

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~233 days

Total

3

Last Release

3604d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ccb57ae849b67ade8d9c1e266bc2868183bbcf07fb6c66c2d45254a452272d54?d=identicon)[jadb](/maintainers/jadb)

---

Top Contributors

[![ADmad](https://avatars.githubusercontent.com/u/142658?v=4)](https://github.com/ADmad "ADmad (8 commits)")[![jadb](https://avatars.githubusercontent.com/u/33527?v=4)](https://github.com/jadb "jadb (8 commits)")

---

Tags

facebookcakephptwittersocialgourmet

### Embed Badge

![Health badge](/badges/gourmet-social-meta/health.svg)

```
[![Health](https://phpackages.com/badges/gourmet-social-meta/health.svg)](https://phpackages.com/packages/gourmet-social-meta)
```

###  Alternatives

[hybridauth/hybridauth

PHP Social Authentication Library

3.4k8.5M94](/packages/hybridauth-hybridauth)[wrav/oembed

A simple plugin to extract media information from websites, like youtube videos, twitter statuses or blog articles.

36205.0k3](/packages/wrav-oembed)[friendsofcake/crud-json-api

Listener for building CakePHP Crud APIs following the JSON API specification.

58445.4k3](/packages/friendsofcake-crud-json-api)[edujugon/social-auto-post

PHP and Laravel 5 Package to post on Twitter

135.9k](/packages/edujugon-social-auto-post)

PHPackages © 2026

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