我正在尝试创建一个自定义模块(研究目的)来显示特定用户的付款详细信息。
我被困在块和布局之间,并收到如下错误:
致命错误:调用成员函数 append()
<?php
class PITS_Pitsnews_PaymentController extends Mage_Core_Controller_Front_Action {
protected function _getSession() {
return Mage::getSingleton('customer/session');
}
public function indexAction() {
$this->loadLayout();
$this->_initLayoutMessages('customer/session');
$session = $this->_getSession();
if (!$this->_getSession()->isLoggedIn()) {
$this->_redirect('customer/account/login/');
return;
}
$this->getLayout()->getBlock('pitsnews')->append(
$this->getLayout()->createBlock('pitsnews/pitsnews')
);
$this->getLayout()->getBlock('pitsnews/pitsnews')->assign('data', $data);
$this->renderLayout();
}
}