Toro - 基於PHP的REST開發框架

jieforest發表於2012-08-26
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:


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

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

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/301743/viewspace-741918/,如需轉載,請註明出處,否則將追究法律責任。

相關文章