我的PHP版本是5.5.11 而且一切都是最新的。Magento:錯誤404在插件
我的插件顯示在管理面板,但是當我訪問的URL它給了我錯誤404 網址:<sitename>/index.php/module/index
Testplugin_Module在管理面板啓用。
這裏是配置文件: 區域設置/ Testplugin /模塊的/ etc/config.xml中
<?xml version="1.0"?>
<config>
<modules>
<Testplugin_Module>
<version>0.1.0</version> <!-- Version number of your module -->
</Testplugin_Module>
</modules>
<frontend>
<routers>
<module>
<use>standard</use>
<args>
<module>Testplugin_Module</module>
<frontName>module</frontName>
</args>
</module>
</routers>
<layout>
<updates>
<module>
<file>module.xml</file> <!-- Our layout file name-->
</module>
</updates>
</layout>
</frontend>
<global>
<blocks>
<module>
<class>Testplugin_Module_Block</class>
</module>
</blocks>
</global>
</config>
這裏是插件: 應用的/ etc /模塊/ Testplugin_Module.xml
<?xml version="1.0"?>
<config>
<modules>
<Testplugin_Module>
<active>true</active>
<codePool>local</codePool>
</Testplugin_Module>
</modules>
</config>
這裏是索引控制器: locale/Testplugin/Module/controllers/IndexController.php
<?php
class Testplugin_Module_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction()
{
echo "Hello tuts+ World";
}
}
?>
我已經從管理面板禁用了緩存,並且我嘗試了重新啓動燈泡,並且我也嘗試登錄並註銷,但仍然沒有成功。 不知道什麼是錯的,任何幫助將不勝感激。
編輯:
做出的佈局: 我在應用程序/設計/前端/基/默認/佈局/ module.xml
<?xml version="1.0"?>
<layout version="0.1.0">
<module_index_index>
<reference name="content">
<block type="module/module" name="module" template="module/module.phtml" />
</reference>
</module_index_index>
</layout>
模板所做的佈局: 應用程序/設計/前端/base/default/template/module/module.phtml
<?php
echo $this->myfunction();
?>
塊:本地/ Testplugin /模塊/塊/ Module.php
<?php
class Testplugin_Module_Block_Module extends
Mage_Core_Block_Template
{
public function myfunction()
{
return "Hello tuts+ world";
}
}
?>
@ user1735921:它工作嗎? – urfusion
沒有工作,仍然在404 .. – user1735921
把'die('here')'放在'public function indexAction()'中。並檢查它是否打印'here'? – urfusion