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

PHP 路由:Klein.php

WBOY
Release: 2016-06-20 12:52:35
Original
1450 people have browsed it

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();
Copy after login

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

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template