承接 anwarachilles/nirvana-native-php 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

anwarachilles/nirvana-native-php

Composer 安装命令:

composer require anwarachilles/nirvana-native-php

包简介

Lightweight & simple PHP Rest Http

README 文档

README

Lightweight tool for building simple Rest HTTP/API in PHP programming language environment

version - Beta

Example Use

Install with composer

composer require anwarachilles/nirvana-native-php

PHP structure

Create an index.php file, then setup environment & rest, like the example below.

Nirvana::environment([
  'Configure'=> [
    'development'=> true,
    'baseurl'=> 'http://localhost/<yourproject>/',
  ]
]);


Nirvana::rest('GET', 'demo', function() {
  return [
    'name'=> Nirvana::method('name'),
    'code'=> Nirvana::method('code'),
  ];
});

API Reference

Environment configure

Properties Type Description
development string Optional. will return response with development dataset
basedir __DIR__ Required set default baseurl from the project
baseurl string Required set default baseurl from the project

Nirvana inside Rest

Method & Properties Type Description
method string return data on method requested.
load string load another Rest.
data string (Under Development)
store name get data from store can do CRUD

Nirvana outside Rest

Method & Properties Type Description
ifNotFound void set default 404 not found if request not have Rest.
store name, data array set data to store.

Special handler store

Method & Properties Type Description
set array insert/create data to store
get idorvoid view/load data from store
put id, array update/load data from store
del id delete/remove data from store
find field, valueorvoid view data from store with specified field and value, or only field

DEVNEET-ID

统计信息

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

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-13