定制 mrstroz/yii2-wavecms-metatags 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mrstroz/yii2-wavecms-metatags

最新稳定版本:0.2.3

Composer 安装命令:

composer require mrstroz/yii2-wavecms-metatags

包简介

Meta tags for WaveCMS

README 文档

README

Meta tags module for Yii 2 WaveCMS.

Please do all install steps first from Yii 2 WaveCMS.

Installation

The preferred way to install this extension is through composer.

Run

composer require --prefer-source "mrstroz/yii2-wavecms-metatags" "~0.2.0"

or add

"mrstroz/yii2-wavecms-metatags": "~0.2.0"

to the require section of your composer.json file.

Required

  1. Run migration

Add the migrationPath in console/config/main.php and run yii migrate:

// Add migrationPaths to console config:
'controllerMap' => [
    'migrate' => [
        'class' => 'yii\console\controllers\MigrateController',
        'migrationPath' => [
            '@vendor/mrstroz/yii2-wavecms-metatags/migrations'  
        ],
    ],
],

Or run migrates directly

yii migrate/up --migrationPath=@vendor/mrstroz/yii2-wavecms-metatags/migrations
  1. Add behavior and attributes to your model
// ...
class Page extends ActiveRecord
{

    public function behaviors()
    {
        return [
            // ...
            'meta_tags' => [
                'class' => MetaTagsBehavior::className()
            ],
        ];
    }
  1. Use MetaTags helper to register meta tags
$page = Page::find()->one();
\mrstroz\wavecms\metatags\components\helpers\MetaTags::register($page->metaTags);

//or

$metaTags = \mrstroz\wavecms\metatags\models\MetaTags::find()->one();
\mrstroz\wavecms\metatags\components\helpers\MetaTags::register($metaTags);

统计信息

  • 总下载量: 176
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 2
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-12-21