【发布时间】:2017-05-16 13:01:21
【问题描述】:
我在潜在客户菜单中创建了一个自定义子菜单作为“Process Leads”,现在我想在该菜单项的帮助下调用一个自定义函数。我将其定义为:
$menu_item[]=Array("index.php?module=Leads&action=callCustom", "Process Leads", "");
现在的问题是,我应该在代码中哪里定义这个callCustom 函数?
【问题讨论】:
-
不太清楚你在问什么,因为它是将 GET 操作引用到
index.phpcallCustom应该在index.php内。然后if($_GET['action'] == "callCustom") { callCustom(); } -
只有在 index.php 中,它才会在 Leads 模块上创建一个 ajax 调用,但我没有得到应该在 index.php 中定义这个函数的地方,我们无法定义它。 @AntonisTsimourtos
-
可以分享
index.php的代码吗?你几乎可以在任何地方定义它.. -
包括'include/MVC/preDispatch.php'; $startTime = 微时间(真); require_once 'include/entryPoint.php'; ob_start(); require_once 'include/MVC/SugarApplication.php'; $app = new SugarApplication(); $app->startSession(); $app->execute();