嗨,我只是在magento中創建自定義模塊,它的前端不起作用。創建自定義佈局模塊
配置文件:
<?xml version="1.0"?>
<config>
<modules>
<Shareino_Sync>
<version>0.1.0</version>
</Shareino_Sync>
</modules>
<global>
<helpers>
<sync>
<class>Shareino_Sync_Helper</class>
</sync>
</helpers>
<blocks>
<sync>
<class>Shareino_Sync_Block</class>
</sync>
</blocks>
</global>
<frontend>
<routers>
<sync>
<use>standard</use>
<args>
<module>Shareino_Sync</module>
<frontName>shareinosync</frontName>
</args>
</sync>
</routers>
<layout>
<updates>
<sync>
<file>shareino_front.xml</file>
</sync>
</updates>
</layout>
</frontend>
</config>
佈局文件:
# File in : app/design/frontend/default/default/layout/shareino_front.xml
<layout version="0.1.0">
<sync_index_index>
<reference name="content">
<block type="sync/sync" name="sync" template="sync_index.phtml" />
</reference>
</sync_index_index>
</layout>
而且sync_index.phtml
:
# file in app/design/frontend/default/default/template/sync_index.phtml
<h1>
Test Text
</h1>
我創建了一個名爲Sync.php
在結束我的控制器:
class Shareino_Sync_IndexController extends Mage_Core_Controller_Front_Action
{
public function indexAction(){
$this->loadLayout();
$this->renderLayout();
}
public function testAction(){
echo "index Action";
}
}
我想我所做的每想好,但是當我在瀏覽器中加載的操作URL它沒有做我的佈局。請幫助我瞭解我的錯誤。