houseoftech/cakephp-meta
Composer 安装命令:
composer require houseoftech/cakephp-meta
包简介
SEO Plugin for CakePHP 2.x which manages title, meta description, and meta keywords for each page in your application.
README 文档
README
#Meta Plugin for CakePHP 2.x
Meta is an SEO Plugin for CakePHP 2.x which manages title, meta description, and meta keywords for each page in your application.
For CakePHP 3.x compatible version see the 3.x branch.
##Installation
-
Install manually by putting the contents of this repository in a folder named Meta in your App's Plugin folder. Install with composer by adding the following to your composer.json:
"require": { "houseoftech/cakephp-meta": "2.0.0" } -
Add the meta table to your database.
CREATE TABLE `meta` ( `id` int(11) unsigned NOT NULL AUTO_INCREMENT, `template` tinyint(1) NOT NULL DEFAULT '0', `path` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `controller` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `action` varchar(255) COLLATE utf8_unicode_ci NOT NULL, `pass` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `description` text COLLATE utf8_unicode_ci, `keywords` text COLLATE utf8_unicode_ci, `created` datetime DEFAULT NULL, `modified` datetime DEFAULT NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci PACK_KEYS=0 ; -
Add the component to your AppController.
public $components = array('Meta.Meta'); -
Call the Meta element in your layout's head.
<?php echo $this->element('Meta.meta');?>
##How to Use
Navigate to the Meta admin page: http://your_domain/admin/meta/meta
You can add records manually via the form or you can use the link called 'Find New Paths'. This is an initializer which searches your existing pages located under Views/Pages/ and the pages table in your database. The initializer will attempt to extract descriptions as well.
##Meta Record Fields
Given a URL such as http://your_domain/pages/My-Wonderful-Page-In-Which-I-Explain-All-Things we can break it down to the following fields stored in the meta table.
###Path
This is for your benefit, so you know which page it corresponds to. /pages/My-Wonderful-Page-In-Which-I-Explain-All-Things
To create a template use an asterisk as a wildcard. /articles/view/* would match any Path beginning with /articles/view/
###Controller pages
###Action display
###Pass My-Wonderful-Page-In-Which-I-Explain-All-Things
When creating a template, leave this field blank.
###Title The Explanation of All Things
###Description All things need some sort of explanation. Explaining all things is not always easy, but I will attempt to do so anyways.
###Keywords all things, explanation, explaining, all things explained, explanation of all things
###Templates When creating a template, you can use variables in the Title, Description, and Keywords fields. Simply use the variable name inside brackets {}.
The available variables depend on the Controller, but most Pages will have available the following list.
- {id} - Automatically assigned integer representing a record in a database.
- {name} - The human readable title of a Page or Post.
- {created} - The date and time the record was first created in format yyyy-mm-dd hh:mm:ss.
- {modified} - The date and time the record was last updated in format yyyy-mm-dd hh:mm:ss.
##License This project is licensed under the terms of the MIT license.
houseoftech/cakephp-meta 适用场景与选型建议
houseoftech/cakephp-meta 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 115 次下载、GitHub Stars 达 4, 最近一次更新时间为 2015 年 03 月 26 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「plugin」 「cakephp」 「meta」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 houseoftech/cakephp-meta 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 houseoftech/cakephp-meta 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 houseoftech/cakephp-meta 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
CakePHP 4.x AdminLTE Theme.
Harvest statistics and meta data from an URL or his source code (seo oriented).
Phalcon PHP Meta tags service
A SilverStripe module to optimise the Meta, crawling, indexing, and sharing of your website content (forked from Cyber-Duck/Silverstripe-SEO)
Help to manage meta data on Laravel Eloquent model
A simple, repeatable field type
统计信息
- 总下载量: 115
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 17
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-03-26