99designs/relax 问题修复 & 功能扩展

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

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

99designs/relax

最新稳定版本:2.0.0

Composer 安装命令:

composer require 99designs/relax

包简介

A library for consuming simple REST services in PHP5.

README 文档

README

Relax is a client designed to interact with APIs that conform to the following:

  • Return JSON
  • Respond to GET, PUT AND POST
  • Urls map to the pattern of /collection/123/subcollection/234

Relax also provides a set of Openssl helper classes.

<?php


$client = new \Ergo\Http\Client("http://mywebservice.io");

$model = new Relax_Client_Model($client);
$model
  ->hasMany(
      $model->define('Transaction')
        ->hasMany('PaymentDevice')
        ->hasMany('PaymentIntention')
        ->hasMany('TransactionItem','items','item')
      )
  ->hasMany(
      $model->define('Customer')
        ->hasOne('Address')
      )
;


// GET queries
$items = $model->transactions(1)->items(); // returns a collection from /transactions/1/items
$address = $model->customers(1)->address(); // returns a resource from /customers/1/address

print $address->streetname; // returns the streetname property from the json doc
print $items->count(); // returns the number of items in the transaction

// PUT queries
$model->customers()->create(array('i'=>'x'));

// POST queries
$model->customers(1)->set('name','Fred')->save();

Copyright

Copyright (c) 2012 99designs See LICENSE for details.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2013-01-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固