2017 © Pedro Peláez
 

yii2-extension yii2-meta

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

image

ptheofan/yii2-meta

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

  • Thursday, October 30, 2014
  • by ptheofan
  • Repository
  • 2 Watchers
  • 6 Stars
  • 562 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 1 Versions
  • 11 % Grown

The README.md

Web Page Metadata

DB based web page metadata for SEO performance annoying free development., (*1)

What's next

Take into account the route named parameters, done
Enable regex based acceptance criteria for the named parameters, (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

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

or add, (*5)

"ptheofan/yii2-meta": "*"

to the require section of your composer.json file., (*6)

Usage

Basic Usage In your components configuration add the following, (*7)

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

run the migration by running, (*8)

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

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

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., (*10)

You can optionally override data by specifying them in a parameter array, (*11)

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

or you can use defaults to be used throughout the site in the component config, (*12)

'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., (*13)

The Versions

30/10 2014

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

by Paris Theofanidis

extension yii2 page metadata