2017 © Pedro Peláez
 

yii2-extension yii2-seokit

Set of tools that helps to construct SEO-friendly site

image

comradepashka/yii2-seokit

Set of tools that helps to construct SEO-friendly site

  • Thursday, April 7, 2016
  • by ComradePashka
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Yii2 framework SEO extension

SEOkit is a set of tools that helps to construct SEO-friendly site., (*1)

UrlHistoryBehavior handle any changes of chosen model attribute such as URL for later use, e.g. redirection to actual URL fo model., (*2)

2do list - have to find way how to handle complex model Primary Key when create dynamic relation, (*3)

Changes

Fix changes with empty url, (*4)

Installation

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

Either run, (*6)

php composer.phar require --prefer-dist comradepashka/yii2-seokit "dev-master"

or add, (*7)

"comradepashka/yii2-seokit": "dev-master"

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

Update database schema

$ php yii migrate/up --migrationPath=@vendor/comradepashka/yii2-seokit/migrations

Configure

Add behavior to a model, (*9)

    public function behaviors()
    {
        return array_merge(parent::behaviors(), [
            [
                'class' => UrlHistoryBehavior::className(),
                'url_attribute' => 'url' // default
            ]
        ]);
    }

Usage

To list all previous urls:, (*10)

    foreach ($model->UrlHistory as $item) {
        echo %item->old_url;
    };

In the Front controller you can check if there was an old URL that should be redirected to actual document:, (*11)

    if ($url = $model->checkRedirect($someOldUrl))
        $this->redirect($url, 301);

The Versions

07/04 2016

dev-master

9999999-dev

Set of tools that helps to construct SEO-friendly site

  Sources   Download

Apache-2.0

The Requires

 

by Pavel Sokolov

extension yii2 seo url history

05/04 2016

0.0.0.5

0.0.0.5

Set of tools that helps to construct SEO-friendly site

  Sources   Download

Apache-2.0

The Requires

 

by Pavel Sokolov

extension yii2 seo url history

05/04 2016

0.0.0.3

0.0.0.3

Set of tools that helps to construct SEO-friendly site

  Sources   Download

Apache-2.0

The Requires

 

by Pavel Sokolov

extension yii2 seo url history

05/04 2016

0.0.0.4

0.0.0.4

Set of tools that helps to construct SEO-friendly site

  Sources   Download

Apache-2.0

The Requires

 

by Pavel Sokolov

extension yii2 seo url history

03/04 2016

0.0.0.2

0.0.0.2

Set of tools that helps to construct SEO-friendly site

  Sources   Download

Apache-2.0

The Requires

 

by Pavel Sokolov

extension yii2 seo