已解決: 愚蠢的我,我編譯啓用...關閉它,事情按預期工作。謝謝你的時間:)Magento 1.7試圖從後端塊內呈現內容
我要生氣了。我一直在嘗試一切(除了正確的)以獲得這個工作,但沒有內容被渲染,除了標準菜單。 我試圖創建一個簡單的塊呈現一個在「你好」的後臺,如果我例如複製 如果我從catalog.xml中複製法師的塊工作正常
<block type="adminhtml/catalog_product" name="products_list">
請指點。
config.xml中
<?xml version="1.0"?>
<config>
<modules>
<Wish_Scheduleproduct>
<version>0.0.1</version>
</Wish_Scheduleproduct>
</modules>
<global>
<models>
<scheduleproduct>
<class>Wish_Scheduleproduct_Model</class>
</scheduleproduct>
</models>
<helpers>
<scheduleproduct>
<class>Wish_Scheduleproduct_Helper</class>
</scheduleproduct>
</helpers>
<blocks>
<scheduleproduct>
<class>Wish_Scheduleproduct_Block</class>
</scheduleproduct>
</blocks>
</global>
<frontend>
<routers>
<scheduleproduct>
<use>standard</use>
<args>
<module>Wish_Scheduleproduct</module>
<frontName>scheduleproduct</frontName>
</args>
</scheduleproduct>
</routers>
<layout>
<updates>
<wish_scheduleproduct>
<file>scheduleproduct.xml</file>
</wish_scheduleproduct>
</updates>
</layout>
</frontend>
<admin>
<routers>
<scheduleproduct>
<use>admin</use>
<args>
<module>Wish_Scheduleproduct</module>
<frontName>scheduleproduct</frontName>
</args>
</scheduleproduct>
</routers>
</admin>
<adminhtml>
<layout>
<updates>
<scheduleproduct>
<file>scheduleproduct.xml</file>
</scheduleproduct>
</updates>
</layout>
<menu>
<scheduleproduct translate="title">
<title>Schedule product</title>
<sort_order>40</sort_order>
<depends>
<module>Wish_Scheduleproduct</module>
</depends>
<children>
<openings translate="title">
<title>Handle open hours</title>
<action>scheduleproduct/admin_schedule</action>
<sort_order>1</sort_order>
</openings>
</children>
</scheduleproduct>
</menu>
</adminhtml>
</config>
scheduleproduct.xml(佈局更新)
<?xml version="1.0"?>
<layout version="0.1.0">
<scheduleproduct_admin_schedule_index>
<reference name="menu">
<action method="setActive"><menupath>scheduleproduct/openings</menupath></action>
</reference>
<reference name="content">
<block type="scheduleproduct/admin_test" name="myTester" />
</reference>
</scheduleproduct_admin_schedule_index>
</layout>
ScheduleController.php
class Wish_Scheduleproduct_Admin_ScheduleController extends Mage_Adminhtml_Controller_Action
{
public function indexAction()
{
$this->loadLayout();
$this->renderLayout();
}
}
該座
<?php
class Wish_Scheduleproduct_Block_Admin_Test extends Mage_Adminhtml_Block_Template
{
protected function _construct()
{
echo "Hello";;
}
}
Filetree here:http://i.stack.imgur.com/N0QLG.png
謝謝你的幫忙!
我檢查了從mageFindClassFile方法生成的包含路徑,它似乎沒有包含塊路徑。
難道是在你的「塊」的代碼去除雙分號一樣簡單? –
哦,不,我的朋友,那很容易。 – Wishdale
/var/log/*文件中是否有錯誤? – Norton