Tonic : 开发RESTful风格Web应用的PHP微型框架
jopen
12年前
Toni是一个开源PHP微型框架,用于开发RESTful风格Web应用。
特性:
- URI 注释
- 资源与URL的映射会是通过一个@uri注释实现
- Content negotiation
- Content and language negotiation support allowing you to easily pick the best representation for the client request.
- Method conditions
- Custom conditions can be added to methods via annotations allowing for conditional routing behaviour to be easily encapsulated.
- Mount points
- Mount namespaces of resources into any URL-space to make them portable.
01 <?php 02 03 /** 04 * @uri /hello 05 * @uri /hello/:name 06 */ 07 class Hello extends Tonic\Resource { 08 09 /** 10 * @method GET 11 * @provides text/html 12 */ 13 function sayHello($name = 'World') { 14 return 'Hello '.$name; 15 } 16 }