定制 label305/hittable 二次开发

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

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

label305/hittable

Composer 安装命令:

composer require label305/hittable

包简介

Behavior for registering hits

README 文档

README

For registering hits on models

No maintenance intended

This project is no longer actively maintained. It does its job, but there are no plans to extend or change it.

Install

Add the repository to your requirements and load using composer

    "require": {
        "label305/hittable": "dev-master"
    }

To install the corresponding hits table, run schema create --plugin=Hittable in the Cake shell

Usage

Basic

Load Hittable.Hittable as behavior in the model you want to have hits registered for. After this you can register hits like:

	$this->Page->id = 1;
	$this->Page->registerHit();

Which will result in an entry in the hits table.

To retrieve the hits you can use the hits call like you've been used to with find. For example:

	$this->Page->hits('count', array(
		'conditions' => array(
			'Page.id' => 1
		)
	));

will return the number of hits on Page with id 1, note that this call is internally handled by calling find on the Hit model which has a belongsTo association that handle the conditions.

Automatic

If you want to set and forget it is possible to turn on automatic registering of hits. You can turn this on by settings the automatic settings while loading:

	$actsAs = array(
		'Hittable.Hittable' => array(
			'automatic' => true
		)
	);

License

Copyright 2014 Label305 B.V.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unknown
  • 更新时间: 2014-11-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固