我已经创建了一个自定义模块(batch_Batches),在sugarcrm 6.3.0.RC2中有一个自定义视图。当导航到index.php?module=batch_Batches&action=myhello
时,我得到错误:
致命错误:嵌套级别太深-递归依赖关系?在C:'sugar2'SugarCRM'include'utils.php on line 1038
这些是我为自定义视图创建的文件。我错过了什么?
模块' batch_Batches ' views ' view.myHello.php :
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
require_once('include/MVC/View/SugarView.php');
class myHello extends SugarView {
public function __construct() {
parent::SugarView();
}
public function display() {
echo "ok";
}
}
模块' batch_Batches ' action_view_map.php :
$action_view_map['myHello']= 'myHello';
模块' batch_Batches ' controller.php :
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
class Batch_BatchesController extends SugarController {
function action_myHello()
{
$this->view='myHello';
}
}
对于非自定义模块,当视图类的名称错误时,就会发生这种情况。
例如,如果模块是Contacts,那么视图应该是ContactsViewmyHello
的例子:
class ContactsViewmyHello extends SugarView {
public function __construct() {
parent::SugarView();
}
public function display() {
echo "ok";
}
}
我认为你要么需要地图要么需要控制器。我认为你不需要两者都需要。这可能会导致循环
view.myHello.php filename应为小写:模块' batch_Batches ' views ' view.myhello.php: