创建模块helloworld magento
我跟着教程走了 但我不知道为什么filipeferminiano.com/lojateste/helloworld链接不起作用。 这是我的config.xml创建模块helloworld magento,magento,Magento,我跟着教程走了 但我不知道为什么filipeferminiano.com/lojateste/helloworld链接不起作用。 这是我的config.xml <config> <modules> <ffdotcom_Helloworld> <version>0.1.0</version> </ffdotcom_Helloworld> </modules> <fron
<config>
<modules>
<ffdotcom_Helloworld>
<version>0.1.0</version>
</ffdotcom_Helloworld>
</modules> <frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>ffdotcom_Helloworld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
<?xml version="1.0"?>
<config>
<modules>
<Ffdotcom_Helloworld>
<version>1.0.0</version>
</Ffdotcom_Helloworld>
</modules>
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>Ffdotcom_Helloworld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
</config>
0.1.0
标准
ffdotcom_Helloworld
地狱世界
在
frontend/routters/helloworld/args
xpath中,模块名称中的第一个“f”必须大写 创建:app/code/local/Ffdotcom/Helloworld/etc/config.xml
<config>
<modules>
<ffdotcom_Helloworld>
<version>0.1.0</version>
</ffdotcom_Helloworld>
</modules> <frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>ffdotcom_Helloworld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
<?xml version="1.0"?>
<config>
<modules>
<Ffdotcom_Helloworld>
<version>1.0.0</version>
</Ffdotcom_Helloworld>
</modules>
<frontend>
<routers>
<helloworld>
<use>standard</use>
<args>
<module>Ffdotcom_Helloworld</module>
<frontName>helloworld</frontName>
</args>
</helloworld>
</routers>
</frontend>
</config>
1.0.0
标准
Ffdotcom_Helloworld
地狱世界
创建:app/code/local/Ffdotcom/Helloworld/controllers/IndexController.php
<?php
class Ffdotcom_Helloworld_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction(){
echo 'hello world';
}
}
将控制器文件添加到POST这是您的基本链接吗?然后,您的控制器必须是IndexController.php,操作名称将是indexAction()和扩展类Mage_Core_controller_Front_action,如果这些都在您的代码中正确,请在post中添加示例,请将您的模块声明文件从APP/ETC/MAMPs发布,对于那些试图在模块激活的情况下工作的人,请考虑。我遵照指示并为我工作。是的,这是我的基本链接。我的IndexController.php是:类Ffdotcom_Helloworld_IndexController扩展了Mage_Core_Controller_Front_Action{public function indexAction(){echo'Hello Index!';}}我已经在所有文件中将Ffdotcom更改为Ffdotcom,我的模块声明在一个文件Ffdotcom_helloworld.xml中,代码为:true local