我在我的Model类中:
Mage::getDesign()->setArea(Mage_Core_Model_App_Area::AREA_FRONTEND);
$layout = Mage::app()->getLayout();
$block = $layout->createBlock('core/template','blockname');
$block->setTemplate('cronjob/items.phtml');
$blockProducts = $block->toHtml();
如果我使用这些,Magento警告我:
CRIT(2):无效的模板文件:frontend \ base \ default \ template \ cronjob / items.phtml
文件items.phtml位于以下路径: C:\瓦帕\ WWW \ Magento的\应用\设计\前端\默认\ customtheme \模板\的cronjob \ items.phtml
答案 0 :(得分:0)
从
复制items.phtml文件C:\wamp\www\magento\app\design\frontend\default\customtheme\template\cronjob\items.phtml
到
C:\wamp\www\magento\app\design\frontend\base\default\template\cronjob/items.phtml