1
Im試圖創建可以在外部訪問的Magento中的端點。所以,我有這在我的模塊控制器Magento - 創建不需要密鑰的AJAX端點
public function jsonAction()
{
$json = json_encode(['test' => 'test']);
$this->getResponse()->setHeader('Content-type', 'application/json');
$this->getResponse()->setBody($json);
}
如果我使用下面
$test = Mage::helper("adminhtml")->getUrl("test/test/json");
它生成一個URL上年底鍵,然後按網址,如下所示:
http://test.app/index.php/test/test/json/key/b4070b1261af163467793da673a4df4a/
這按預期工作,並返回JSON。
的問題是,我需要從外部網站訪問該不會是能夠生成密鑰,以便我試着去得到它只是
http://test.app/index.php/test/test/json
任何的工作有所幫助,將不勝感激
磁模塊的config.xml
<routers>
<test>
<use>admin</use>
<args>
<module>Test</module>
<frontName>test</frontName>
</args>
</test>
</routers>