marcj / php-rest-service

Php-Rest-Service is a very simple and fast PHP class for server-side RESTful JSON APIs.
MIT License
216 stars 74 forks source link

Set router url paths #12

Closed ntvsx193 closed 10 years ago

ntvsx193 commented 10 years ago

Hello!) I have url /page/overview, used Auto-collect

core

Server::create(API_URL, 'App\Router')
    ->setDebugMode(DEBUG)
    ->collectRoutes()
    ->run();

method

    /**
     * @url page/overview
     * @return int
     */
    public function getPageOverview(){
        return 1;
    }

How can i have name method for no user comments renamed url?

What about this type of methods to parse "/"?

public function getPage_Overview_And_More_Slashes(){
        return 1;
    }

/page/overview/and/more/slashes

It a good solution!

marcj commented 10 years ago

What is wrong with the @url annotation?

ntvsx193 commented 10 years ago

The method name is parsed, can not work with /. Ie it would be nice to parse the method name getPage_Overview_ .... rout in /page/overview .. etc.