PHPackages                             floor12/yii2-metamaster - 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. [Templating &amp; Views](/categories/templating)
4. /
5. floor12/yii2-metamaster

ActiveYii2-component[Templating &amp; Views](/categories/templating)

floor12/yii2-metamaster
=======================

This Yii2 component helps to organize page title, meta tags and `og` and `twitter` open graph tags in with a fiew lines of code.

1.2.6(2y ago)75.1k72MITPHPPHP &gt;=7.1.0

Since Jul 5Pushed 1y ago4 watchersCompare

[ Source](https://github.com/floor12/yii2-metamaster)[ Packagist](https://packagist.org/packages/floor12/yii2-metamaster)[ RSS](/packages/floor12-yii2-metamaster/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (20)Used By (2)

yii2-metamaster
===============

[](#yii2-metamaster)

[![Build Status](https://camo.githubusercontent.com/23e8b7e0c41781e520609f680a437bd77817a13b3047fa1139b413261f697e67/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f666c6f6f7231322f796969322d6d6574616d61737465722f6261646765732f6275696c642e706e673f623d6d6173746572)](https://travis-ci.org/floor12/yii2-metamaster)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/4208e5f2767436c0d44a86b35b2f770e4fbc24ad2d195c5bf03b6d441c9667b0/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f666c6f6f7231322f796969322d6d6574616d61737465722f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/floor12/yii2-metamaster/?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/bac2f324040f571badddef42d3d2696c7787d1726e7b5b795b29097ac1b863b0/68747470733a2f2f706f7365722e707567782e6f72672f666c6f6f7231322f796969322d6d6574616d61737465722f762f737461626c65)](https://packagist.org/packages/floor12/yii2-metamaster)[![Latest Unstable Version](https://camo.githubusercontent.com/c3e3e14a2aaf94b983e75853cb7cacbe72de3a303bdb644163f39bbfcfd15723/68747470733a2f2f706f7365722e707567782e6f72672f666c6f6f7231322f796969322d6d6574616d61737465722f762f756e737461626c65)](https://packagist.org/packages/floor12/yii2-metamaster)[![Total Downloads](https://camo.githubusercontent.com/0b1307676c0c306766f01ec0f64f8c2bf7fb38c94848b8ada7115e930295f2e0/68747470733a2f2f706f7365722e707567782e6f72672f666c6f6f7231322f796969322d6d6574616d61737465722f646f776e6c6f616473)](https://packagist.org/packages/floor12/yii2-metamaster)[![License](https://camo.githubusercontent.com/2e65d8febafbb8d6819ed7dd808709e8ed6d873d26d813fb9a4b3f2365bf806b/68747470733a2f2f706f7365722e707567782e6f72672f666c6f6f7231322f796969322d6d6574616d61737465722f6c6963656e7365)](https://packagist.org/packages/floor12/yii2-metamaster)

*Этот файл так же доступен на [русском языке](README_RUS.md).*

This is a component for generate some Meta, Open Graph and Twitter-card tags in a template header of Yii2 app.

This is a list of supported tags:

- canonical
- head title
- meta description
- meta keywords
- og:sitename
- og:type
- og:url
- og:title
- og:description
- og:image
- og:image:width
- og:image:height
- twitter:card
- twitter:domain
- twitter:site
- twitter:description
- twitter:image:src
- itemprop:name
- itemprop:image

Installation
------------

[](#installation)

Just run:

```
$ composer require floor12/yii2-metamaster
```

or add this to the require section of your composer.json.

```
"floor12/yii2-metamaster": "dev-master"
```

After that, include some basic metamaster data into `components` section of application config.

```
    'components' => [
        'metamaster' => [
            'class' => 'floor12\metamaster\MetaMaster',
            'siteName' => 'My cool new Web Site',
            'defaultImage' => '/design/export_logo.png',
        ],
    ...
```

Attributes:

1. `siteName` - name of project to show in Open Graph tags;
2. `defaultImage` - web relative path to default image for Open Graph tags;
3. `web` - yii2 alias to web path to read image width and height for Open Graph tags (default is `@app/web`)
4. `protocol` - default protocol to generate links (default is `https`)

Usage
-----

[](#usage)

Its possible to use in any place of your app. Just use setters and then call the `register(View $view)` method with View object passed into it.

Allowed setters:

```
Metamaster::setSiteName(string $value)
Metamaster::setTitle(string $value)
Metamaster::setUrl(string $value)
Metamaster::setType(string $value)
Metamaster::setDescription(string $value)
Metamaster::setImage(string $relativePath, string $absolutePath = null)
```

For example, using in controller:

```
public function actionIndex()
   {
        Yii::$app->metamaster
                   ->setTitle("This is test page")
                   ->setDescription("This is page description")
                   ->setImage('/images/article/image.png')
                   ->register(Yii::$app->getView());

        return $this->render('index');
    }

```

It will generate all you need in template:

```
This is test page

```

###  Health Score

40

—

FairBetter than 88% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity30

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~110 days

Recently: every ~245 days

Total

19

Last Release

878d ago

Major Versions

v0.1.1 → v1.0.02018-07-05

### Community

Maintainers

![](https://www.gravatar.com/avatar/8dc98d778cb18db41a1e5b9df722c56f65f655de44fe0d581484cd8dea31b928?d=identicon)[floor12](/maintainers/floor12)

---

Top Contributors

[![floor12](https://avatars.githubusercontent.com/u/8406969?v=4)](https://github.com/floor12 "floor12 (38 commits)")

---

Tags

yii2seometaopengraph

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/floor12-yii2-metamaster/health.svg)

```
[![Health](https://phpackages.com/badges/floor12-yii2-metamaster/health.svg)](https://phpackages.com/packages/floor12-yii2-metamaster)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[ycs77/inertia-laravel-ssr-head

Simple SSR Head for Inertia Laravel

3211.5k](/packages/ycs77-inertia-laravel-ssr-head)[v0lume/yii2-meta-tags

DB based model meta data for SEO

204.1k](/packages/v0lume-yii2-meta-tags)[dereuromark/cakephp-meta

A CakePHP plugin for SEO meta tags, OpenGraph and Twitter Cards

1012.9k1](/packages/dereuromark-cakephp-meta)[umanskyi31/opengraph

Created a new component for Yii2. The Open Graph component for your website

119.7k](/packages/umanskyi31-opengraph)

PHPackages © 2026

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