开发者

Magento ajax request

开发者 https://www.devze.com 2023-04-11 11:06 出处:网络
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:

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

精彩评论

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

关注公众号