Php 如何在symfony 2中创建restapi原型
您好,为了实现symfony2 base REST api捆绑包,我安装了以下捆绑包Php 如何在symfony 2中创建restapi原型,php,rest,fosrestbundle,fosoauthserverbundle,symfony-2.4,Php,Rest,Fosrestbundle,Fosoauthserverbundle,Symfony 2.4,您好,为了实现symfony2 base REST api捆绑包,我安装了以下捆绑包 用于Oauth2.0基本身份验证的FosOauth服务器包 用于创建REST api的FosRest捆绑包 现在,任何人都可以建议我如何为所有RESTAPI调用响应创建通用原型。 json格式,如 { "responseType" : "[FAILED|PASSED]", "data" : ["RESPECTIVE DATA WILL COME HERE"], "errorCode"
- 用于Oauth2.0基本身份验证的FosOauth服务器包
- 用于创建REST api的FosRest捆绑包
{
"responseType" : "[FAILED|PASSED]",
"data" : ["RESPECTIVE DATA WILL COME HERE"],
"errorCode" : "if any ERROR comes we can set those respective code here",
"errorMessage": "respective error messages either in the string or array"
}
提前感谢:)