generateService()
generateService(\boolen $isInitialize = TRUE) : \PhalApi_Api
Generate service according the service name and method name request from client; throw related custom exception when fail
The main process is as follows:
-
- check whether miss controller name or method name
-
- make sure that both controller file and controller class exists
-
- whether method is callable or not
-
- whether succeed to intitailze controller
Parameters
\boolen | $isInitialize | whether try to initialize after creation |
Throws
- \PhalApi_Exception_BadRequest
非法请求下返回400
Returns
\PhalApi_Api —Api implements