2017 © Pedro Peláez
 

cakephp-plugin hittable

Behavior for registering hits

image

label305/hittable

Behavior for registering hits

  • Monday, October 31, 2016
  • by tscheepers
  • Repository
  • 3 Watchers
  • 2 Stars
  • 1,104 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

CakePHP Hittable Behavior Build Status

For registering hits on models, (*1)

No maintenance intended, (*2)

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

Install

Add the repository to your requirements and load using composer, (*4)

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

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

Usage

Basic

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

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

Which will result in an entry in the hits table., (*7)

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

    $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., (*9)

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:, (*10)

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

License

Copyright 2014 Label305 B.V., (*11)

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, (*12)

http://www.apache.org/licenses/LICENSE-2.0, (*13)

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., (*14)

The Versions

31/10 2016

dev-master

9999999-dev http://www.label305.com

Behavior for registering hits

  Sources   Download

The Requires

 

by Joris Blaak

component cakephp seo hits