Home >Backend Development >PHP Tutorial >PHP 路由:Klein.php

PHP 路由:Klein.php

WBOY
WBOYOriginal
2016-06-20 12:52:351428browse

Klein.php 是用于 PHP 5.3 版本以上的快速且灵活的路由,它有以下特点:

  • 灵活的常规表达(灵感来自于 Sinatra)

  • 一套快速建立 Web App 的样板方法

  • 几乎没有开销:2500+ requests/second

示例代码:

<?phprequire_once __DIR__ . '/vendor/autoload.php';$klein = new \Klein\Klein();$klein->respond('GET', '/hello-world', function () {    return 'Hello World!';});$klein->dispatch();

项目主页:http://www.open-open.com/lib/view/home/1437228896584

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn