嗨,我对SugarCRM还是个新手,还在想办法让自己熟悉一下sugars MVC。
我正在制作一个没有自己的SugarBean的模块,它需要与联系人Bean和Quotes Bean交互。
我的示例代码如下。
我的问题是,如何从view.searchengineer.php文件中的controller.php访问$contact_bean和$quote_bean,以便在加载记录后从它们调用信息。
controller.php
Class PCP_TasksController extends SugarController
{
function action_search_engineers()
{
// Get Contacts ID
$contact_id = $_GET['Contact_id'];
//Load Contacts Bean and pull Record
$contact_bean = New Contact();
$contact_bean->retrieve($contact_id );
//Get Quote ID
$quote_id = $_GET['Quote_id'];
//Load Quotes Module and pull record
$quote_bean = New AOS_Quotes();
$quote_bean->retrieve($quote_id );
$this->view = 'SearchEngineer';
}
}views/view.searchengineer.php
class PCP_tasksViewSearchengineer extends SugarView
{
function display() {
Echo "The Contact Name is ";
Echo "The Quote Ref is ";
}
}发布于 2012-10-15 07:37:32
我只是将相同的代码直接放在视图中。
https://stackoverflow.com/questions/12881313
复制相似问题