承接 ptheofan/yii2-meta 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

ptheofan/yii2-meta

Composer 安装命令:

composer require ptheofan/yii2-meta

包简介

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

README 文档

README

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

What's next

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

Installation

The preferred way to install this extension is through composer.

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

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.

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-10-24

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固