2017 © Pedro Peláez
 

cakephp-plugin endpoints

Simple CakePHP API endpoints plugin for simplicity in connecting to API endpoints

image

bmilesp/endpoints

Simple CakePHP API endpoints plugin for simplicity in connecting to API endpoints

  • Friday, February 27, 2015
  • by bmilesp
  • Repository
  • 1 Watchers
  • 1 Stars
  • 10 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Endpoints

Simple CakePHP API endpoints plugin for simplicity in connecting to API endpoints, (*1)

Requirements

CakePHP => 2.1, (*2)

Installation

[Using Composer], (*3)

View on Packagist, and copy the json snippet for the latest version into your project's composer.json. Eg, v. 2.1.x-dev would look like this:, (*4)

{
    "require": {
        "bmilesp/endpoints": "2.1.x-dev"
    }
}

Enable plugin

Add following lines in yout app/Config/bootstrap.php file, (*5)

Create a database config variable that uses the Endpoints.ApiSource datasource, and the API domain as the host:

public $website_source = array( 'datasource' => 'Endpoints.ApiSource', 'host' => 'website.com' );
Then setup the model by using the behavior and datasource we've just setup:

public $uses = array('website_source'); public $actsAs = array('Endpoints.Endpint');

Usage

To send and retrieve data from an endpoint. here is an example:

function unlock($slug = null){ $postData = array('id' => 23); $result = $this->callEndpoint('/users/get_user_by_id',$postData); return $result->body; }

The Versions

27/02 2015

dev-master

9999999-dev

Simple CakePHP API endpoints plugin for simplicity in connecting to API endpoints

  Sources   Download

The Requires

 

by Avatar bmilesp