是否有独立的PHP路由库? [英] Is there an standalone PHP routing library?

查看:111
本文介绍了是否有独立的PHP路由库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找将一些动态的,REST式的路由添加到PHP应用程序中。我很乐意使用现有的路由库,因此我不必重新发明轮子。然而,当我看到Slim和F3之类的东西时,它们都带有我不想要的东西 - 比如模板和MVC - 都包含在内。因为我只是想要路由,所以最终会在我的应用程序中出现很多我不需要的框架代码。



有没有一个好的库,只有路由?解决方案

请试试 Klein

/ p>

单一文件,独立且强大:

klein.php是一款适用于PHP 5.3+的闪电式快速路由器


  • 灵活的正则表达式路由(受Sinatra启发)
  • 一套用于快速构建




  • 几乎没有开销=> 2500+请求/秒
  • https://github.com/chriso/klein.php\">https://github.com/chriso/klein.php


    I'm looking to add some dynamic, REST-esque routing to a PHP application. I'd love to use an existing routing library so I don't have to reinvent the wheel.

    However, when I look at things like Slim and F3, they all come with things I don't want--like templating and MVC--included. Since I just want routing, I'd end up with a lot of framework code in my application that I don't need.

    Is there a good library out there that only does routing? Or am I stuck with importing a full framework or reinventing the wheel?

    解决方案

    Try Klein:

    Single file, standalone and robust:

    "klein.php is a lightning fast router for PHP 5.3+"

    • Flexible regular expression routing (inspired by Sinatra)
    • A set of boilerplate methods for rapidly building web apps
    • Almost no overhead => 2500+ requests/second

    https://github.com/chriso/klein.php

    这篇关于是否有独立的PHP路由库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆