daxslab/yii2-taggedview
最新稳定版本:1.0.3
Composer 安装命令:
composer require daxslab/yii2-taggedview
包简介
Extension to help setup the standard HTML meta tags besides the ones defined by Opengraph and Twitter to contribute to website SEO
README 文档
README
Extension to help setup the standard HTML meta tags besides the ones defined by Opengraph and TwitterCard to contribute to website SEO
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist daxslab/yii2-taggedview "*"
or add
"daxslab/yii2-taggedview": "*"
to the require section of your composer.json file.
Configuration
Configure the View component into the main configuration file of your application:
'components' => [ //... 'view' => [ 'class' => 'daxslab\taggedview\View', //configure some default values that will be shared by all the pages of the website //if they are not overwritten by the page itself 'image' => 'http://domain.com/images/default-image.jpg', ], //... ]
Defaults
The component will try to set some properties by default:
$this->site_name = Yii::$app->name; $this->url = Yii::$app->request->baseUrl; $this->locale = Yii::$app->language;
You can overwrite the content of this tags in every page or in the component configuration.
Usage
Once the extension is configured, simply use it in your views by:
<?php $this->title = 'page title'; $this->description = 'page description'; $this->keywords = ['keywords', 'for', 'this', 'page']; $this->image = 'http://domain.com/images/page-image.jpg'; ?>
Proudly made by Daxslab.
统计信息
- 总下载量: 4.24k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 11
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-01-14