无法找到它引用的确切类。我试图调用类ListViewSmarty
的对象。
致命错误:非静态方法ListViewSmarty :: ListViewSmarty() 不能静态调用,假设$ this来自不兼容的上下文 在第24行的src / custom / modules / Contacts / ContactsPopupSmarty.php中
当前文件:ContactsPopupSmarty.php
require_once 'include/Popups/PopupSmarty.php';
require_once 'custom/modules/Contacts/ContactsListViewSmarty.php';
/**
* ContactsPopupSmarty for Contacts
*/
class ContactsPopupSmarty extends PopupSmarty
{
/**
* Override constructor
*
* @param SugarBean $seed Contacts Bean
* @param string $module Module Name
*/
public function __construct($seed, $module)
{
parent::__construct($seed, $module);
//Invoke CustomListViewSmarty class
ContactsListViewSmarty::ListViewSmarty();
}
}
以下剂量工作:
$lv = new ListViewSmarty();
$lv->ListViewSmarty();
任何想法?
custom / modules / Contacts / ContactsListViewSmarty.php使用ListViewSmarty进行扩展
require_once 'custom/modules/Contacts/ContactsListViewDisplay.php';
require_once 'include/ListView/ListViewDisplay.php';
/**
* ContactsListViewSmarty for Contacts
*/
class ContactsListViewSmarty extends ListViewSmarty{
/**
* Override Constructor
*/
public function __constuct()
{
parent::__constuct();
//Invoke CustomListViewDisplay
ContactsListViewDisplay::ListViewDisplay();
}
}
'include / ListView / ListViewDisplay.php'文件:
require_once('include/ListView/ListViewData.php');
require_once('include/MassUpdate.php');
class ListViewDisplay {
public function ListViewDisplay(Request $request = null)
{
self::__construct($request);
}
/**
* Constructor
*
* @param Request $request
*/
public function __construct(Request $request = null)
{
$this->request = $request ?: InputValidation::getService();
$this->lvd = new ListViewData($this->request);
$this->searchColumns = array () ;
}