开发者

Magento ajax request

I started writing with magento. I have to do some开发者_StackOverflow社区 ajax request for my own php-script located somewhere in local pull. The questions are: Where to store such php-scripts and with what address access them from ajax-request?


Just create a Controller that has an action that will handle the AJAX call. So if your module has a route of http://www.yoursite.com/yourscript, and you already have your IndexController, just put another action in there such as ajaxAction(). This action will simple print out the data you want to be consumed, and not render the rest of the page. Then you can point your AJAX call to http://www.yoursite.com/yourscript/index/ajax.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜