PHPackages                             ptheofan/yii2-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. [Utility &amp; Helpers](/categories/utility)
4. /
5. ptheofan/yii2-meta

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

ptheofan/yii2-meta
==================

DB based web page meta data for SEO performance and painless development

81.9k2[1 issues](https://github.com/ptheofan/yii2-meta/issues)PHP

Since Oct 30Pushed 11y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Web Page Metadata
=================

[](#web-page-metadata)

DB based web page metadata for SEO performance annoying free development.

What's next
-----------

[](#whats-next)

Take into account the route named parameters, done
Enable regex based acceptance criteria for the named parameters

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist ptheofan/yii2-meta "*"

```

or add

```
"ptheofan/yii2-meta": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Basic Usage In your components configuration add the following

```
'meta' => [
    'class' => 'ptheofan\meta\Meta',
]
```

run the migration by running

```
./yii migrate --migrationPath="@vendor/ptheofan/yii2-meta/migrations"

```

In your code, if you want to automatically set the metadata for a page call

```
Yii::$app->meta->setMeta();
```

This will automatically load the correct row from the database using the currently running route (module/controller/action or controller/action). It will automatically identify and set the canonical, the og:url. The reset depend on the database entry, the argument used and the defaults as identified in your component config.

You can optionally override data by specifying them in a parameter array

```
Yii::$app->meta->setMeta(['title' => 'My cool override']);
```

or you can use defaults to be used throughout the site in the component config

```
'meta' => [
    'class' => 'ptheofan\meta\Meta',
    'defaults' => [
        'og:type' => 'website',
        'author' => 'My Cool Company',
    ],
]
```

The defaults will always override any values passed in through parameter or through the database.

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/791932127b0c9e049f88475ebe52eacf5e79d20bc1de1b819a644f285f61d1f2?d=identicon)[ptheofan](/maintainers/ptheofan)

---

Top Contributors

[![ptheofan](https://avatars.githubusercontent.com/u/880939?v=4)](https://github.com/ptheofan "ptheofan (14 commits)")

### Embed Badge

![Health badge](/badges/ptheofan-yii2-meta/health.svg)

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

###  Alternatives

[bigperson/auto-base-buy

The package allows you to access data through the base car by model

173.6k](/packages/bigperson-auto-base-buy)

PHPackages © 2026

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