当前位置: 首页 > 工具软件 > toro > 使用案例 >

Toro - 基于PHP的REST开发框架

傅啸
2023-12-01
Toro is a PHP router for developing RESTful web applications and APIs. It is designed for minimalists who want to get work done.

Features

1. RESTful routing using strings, regular expressions, and defined types (number, string, alpha)
2. Flexible error handling and callbacks via ToroHook
3. Intuitive and self-documented core (toro.php)
4. Tested with PHP 5.3 and above

"Hello, world"

The canonical "Hello, world" example:

CODE:

<?php

class HelloHandler {
    function get() {
        echo "Hello, world";
    }
}

Toro::serve(array(
    "/" => "HelloHandler",
));

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/301743/viewspace-741918/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/301743/viewspace-741918/

 类似资料: