所以我刚开始使用Phpstorm,我正在尝试“更正”我的代码,因此IDE没有错误。我在下面使用以下方法,并使用'未知HTML标记'突出显示我的所有xml标记
纠正此问题的最佳方法是什么?
private function generate_qbxml_CustomerAddRq($requestID=0){
/** requestID is used when multiple requests are called in order to match the request to the response.
requestID's should be incremented as they are called. Currently not implimented. **/
$qbxml = '';
$qbxml .= '<?xml version="1.0" encoding="utf-8"?>';
$qbxml .= '<?qbxml version="2.0"?>';
$qbxml .= '<QBXML>';
$qbxml .= '<QBXMLMsgsRq onError="stopOnError">';
$qbxml .= '<CustomerAddRq requestID="'.$requestID.'">';
$qbxml .= '<CustomerAdd>';
$qbxml .= '<Name>'.$this->Name.'</Name>'; //Name is a mandatory field. Add a check for this.
/** For all optional values add a check so that xml tags are not sent in request if value is blank**/
$qbxml .= '<CompanyName>'.$this->CompanyName.'</CompanyName>';
$qbxml .= '<FirstName>'.$this->FirstName.'</FirstName>';
$qbxml .= '<LastName>'.$this->LastName.'</LastName>';
$qbxml .= '<BillAddress>';
$qbxml .= '<Addr1>'.$this->BillAddress->get_Addr1().'</Addr1>';
$qbxml .= '<Addr2>'.$this->BillAddress->get_Addr2().'</Addr2>';
$qbxml .= '<City>'.$this->BillAddress->get_City().'</City>';
$qbxml .= '<State>'.$this->BillAddress->get_State().'</State>';
$qbxml .= '<PostalCode>'.$this->BillAddress->get_PostalCode().'</PostalCode>';
$qbxml .= '<Country>'.$this->BillAddress->get_Country().'</Country> ';
$qbxml .= '</BillAddress>';
$qbxml .= '<ShipAddress>';
$qbxml .= '<Addr1>'.$this->ShipAddress->get_Addr1().'</Addr1>';
$qbxml .= '<Addr2>'.$this->ShipAddress->get_Addr2().'</Addr2>';
$qbxml .= '<City>'.$this->ShipAddress->get_City().'</City>';
$qbxml .= '<State>'.$this->ShipAddress->get_State().'</State>';
$qbxml .= '<PostalCode>'.$this->ShipAddress->get_PostalCode().'</PostalCode>';
$qbxml .= '<Country>'.$this->ShipAddress->get_Country().'</Country> ';
$qbxml .= '</ShipAddress>';
$qbxml .= '<Phone>'.$this->Phone.'</Phone>';
$qbxml .= '<AltPhone>'.$this->AltPhone.'</AltPhone> ';
$qbxml .= '<Fax>'.$this->Fax.'</Fax> ';
$qbxml .= '<Email>'.$this->Email.'</Email> ';
//$qbxml .= '<JobDesc>Ob2</JobDesc>';
$qbxml .= '</CustomerAdd>';
$qbxml .= '</CustomerAddRq>';
$qbxml .= '</QBXMLMsgsRq>';
$qbxml .= '</QBXML>';
return $qbxml;
}
答案 0 :(得分:12)
好的,我自己想通了。
Alt + Enter然后选择添加&lt;'tag'&gt;自定义HTML标记。
类似于处理拼写错误的单词。