torchline/frest

该包最新版本(1.0-beta)没有提供许可信息。

1.0-beta 2013-10-16 03:16 UTC

This package is not auto-updated.

Last update: 2024-09-28 14:53:06 UTC


README

此框架自动为您的SQL表添加外观层,并提供非常可配置和强大的API端点。只需为每个资源在json文件中指定所需的行为即可。

定义可以读取的内容、默认读取的内容、外观等。

功能

  • 资源URL路由
  • CRUD操作
  • 单个请求中无限嵌套相关资源
  • 为资源自定义行为的函数
  • 类型检查
  • 分页
  • 条件搜索(>、<、LIKE等)

安装

使用 composer 安装此包

composer require torchline/frest

查询

函数名: gtgteltlteinlike

		?username=like(FullMetal~) - starts with
		?money=gt(50) - greater than
		?hair=in(blonde,black,red) - is one of

部分对象

		?fields=id,username,email - read only these fields back
		?fields=* - read all fields back
		(if no fields specified, it goes to default)

		?fields=name,owner(id, firstName, lastName) - do partial reads on child objects

杂项

	suppress_http_error_codes=true - make request always return 200 with actual http code embeded in response