Luracast / Restler

Simple and effective multi-format Web API Server to host your PHP API as Pragmatic REST and/or RESTful API
http://luracast.com/products/restler/
GNU Lesser General Public License v2.1
1.36k stars 315 forks source link

Custom position "version" #627

Closed nikitaksv closed 2 years ago

nikitaksv commented 5 years ago

My project has a module that has a directory structure for the mvc pattern. The path to the module class: $r->addAPIClass(\api\modules\app\versions\v1\controllers\UserController);. Restler is currently converting this path to find the class as "\api\modules\app\versions\v1\controllers\v1\UserController" It would be very convenient to manually specify the position "v{$version}". I made changes that now allow this to be done. I manually indicate the version position in the api class path. $r->addAPIClass('\api\modules\app\versions\v{$version}\controllers\UserController', ''); Restler converts this path to find the class as "\api\modules\app\versions\v1\controllers\UserController".