houseoftech/cakephp-meta 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

houseoftech/cakephp-meta

最新稳定版本:3.0.0

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

  1. 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"
    }
    
  2. 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 ;
    
  3. Add the component to your AppController.

    public $components = array('Meta.Meta');
    
  4. 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.

统计信息

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

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-03-26