嗨我還是非常新的SugarCRM,並試圖讓我的頭圓糖MVC。在視圖類中訪問beans
我正在製作一個沒有自己的SugarBean的模塊,而是它需要與聯繫人Bean和引用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';
}
}
的意見/ view.searchengineer.php
class PCP_tasksViewSearchengineer extends SugarView
{
function display() {
Echo "The Contact Name is ";
Echo "The Quote Ref is ";
}
}
我需要使用$ this-> view_object_map數組 –