Code Monkey home page Code Monkey logo

router's People

Contributors

liushaohui123 avatar lloydzhou avatar wjiec avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

router's Issues

hook no need to return $params

i did't want return $params in every hooks.
so only hook return false, will trigger 406 error.
but call_user_func_array and call_user_func, can not transfer reference manual, so transfer $this to hook callback. fe25fc5

请教能匹配上,但是无法获值是哪里不对?

    ->get('/Message/photo/:id:d-:index:d-:width:d-:height:d.jpg',function($id, $index,$width,$height){

        $arr = get_defined_vars();

        print_r($arr);

    })

浏览器访问这个URL能正常,但结果是下面这样,是我哪里处理的不对?

Array ( [id] => [index] => [width] => [height] => )

perfomance

using explode to split the path info, instead of preg_match.

文件层级怪怪的

感觉源码文件都放到root下面有点儿不太清晰,不过也就一个文件...
ToT

feature to add hook

add hook like auth and so on.
may be can format parameters before call handler function.

compile feature

compile the matched callback handlers into plain array. do not create array "$_tree" every time.

add hook to group

when define one group, can define hooks for this group.

$router->group('/admin', array('auth'));

this example define group url prefixed by '/admin', and all these urls has 'auth' hook.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.