2015-03-02 28 views
0

友好这是我的自定义模块网址http://192.168.1.18/upload/index.php/capsync/决策网址用户在Magento

我想打电话从控制器apiaction这个下一个动作:

http://192.168.1.18/upload/index.php/capsync/index/api 

但在URL中移除index

http://192.168.1.18/upload/index.php/capsync/api 

我的config.xml页面

<rewrite> 
    <Livelids_Capsync> 
     <from><![CDATA[#^capsync/index/api/#]]></from> 
     <to><![CDATA[api]]></to> 
     <complete>1</complete> 
    </Livelids_Capsync> 
</rewrite> 
+0

嘿那里。清晰的前/后和正确的格式有助于了解你需要什么。 – 2015-03-06 23:46:21

回答

0

在Magento,路由器将解析您的网址如下: http://yoursite.com/[frontName]/[actionControllerName]/[actionMethod]/

在你的情况,对于URL :http://192.168.1.18/upload/index.php/capsync/index/api

frontName :: capsync

actionControllerName :: indexController的

actionMethod :: apiAction

以上是正是你想要的是在控制器下一步行动这将是“apiAction '

同样,如果你想要的网址:http://192.168.1.18/upload/index.php/capsync/api

然后你actionControllerName将转向另一个控制器(apiController)&行动(的indexAction默认情况下)一共是什么我不认为你想

让我知道如果你没有得到这个。谢谢! :)

+0

在同一个控制器中,我想调用像http://192.168.1.18/upload/index.php/capsync/api这样的url,我想在api之前移除索引,它可能吗?先生http://192.168.1.18/upload/index.php/capsync/index/api – 2015-03-03 06:48:56