如何通过Ajax API处理多个请求?(How to handle multiple requests through an Ajax API? [closed])
我有一个大项目需要通过Ajax调用处理多个函数,到目前为止我使用不同的文件来处理每个函数调用。 我知道必须有更好的方法来通过API处理请求
那么在结构方面设计这样一个API的标准做法是什么?
谢谢!
I have a large project that requires multiple functions to be processed through Ajax calls, so far I am using different files to handle each function call. I know there's got to be a better way to handle the requests through an API
And what would be a standard practice for designing such an API in terms of structure?
Thanks!
原文:https://stackoverflow.com/questions/28758882
满意答案
如您所知,默认模块中的控制器名称不需要前缀(Ex:
SomeController
),而非默认模块中的控制器需要前缀(例如:Admin_SomeController
)。在基于模块的应用程序中,我个人发现使用模块名称为所有控制器添加前缀更加一致。 这是作为一个问题提交的,并通过添加前端控制器设置
prefixDefaultModule
显然在版本1.5中prefixDefaultModule
。因此,在
application/configs/application.ini
,您可以添加:
resources.frontController.prefixDefaultModule = true
我一直都在使用它,并认为它很棒。 ;-)
As you note, controller names in the default module do not require prefixing (Ex:
SomeController
), while controllers in non-default modules require prefixing (Ex:Admin_SomeController
).In module-based app, I personally find it more consistent to prefix all controllers with the module name. This was filed as an issue and fixed in apparently in version 1.5 by adding a front controller setting
prefixDefaultModule
.So, in
application/configs/application.ini
, you could add:
resources.frontController.prefixDefaultModule = true
I use it all the time and think it's great. ;-)
相关问答
更多lxml XMLSyntaxError:未找到命名空间的默认前缀(lxml XMLSyntaxError: Namespace default prefix was not found)
XSLT 2.0灵活,具有相同URI的默认或不同的前缀命名空间(XSLT 2.0 flexible with default or different prefixed namespace of the same URI)
在命名空间Kubernetes中创建入口控制器(Create ingress controller in namespace Kubernetes)
Yii - 从URL中消除模块的默认控制器ID(Yii - Eliminate default controller ID for a module from URL)
默认模块中控制器的命名空间/前缀(Namespace / Prefix of Controller in Default Module)
必须在未指定默认命名空间时使用前缀[duplicate](must be used with a prefix when a default namespace is not specified [duplicate])
MVC 4路由前缀和Action url生成问题(MVC 4 route prefix and Action url generation issue)
没有使用默认命名空间的XSL输出XML没有前缀?(XSL output XML with no prefix without using the default namespace?)
如何禁用特定模块的错误控制器(How to disable error controller for a specific module)
在lxml中定义默认命名空间(未加前缀)(Define default namespace (unprefixed) in lxml)
相关文章
更多ajax数据安全的问题
AJAX JSON 乱码
AJAX问题
ajax请求问题,到底哪里错了
图解全文检索SOLR的酷应用[Ajax Solr]
传智播客王兴魁老师AJax视频教程
Ajax彻底研究-视频教程
ajax跨域请求的解决方案
最近遇到一个Ext.Ajax.request的奇怪问题
[IT教程网]Ajax和jQuery基础入门视频[已经完结]
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!