, 라인 (422)
그들은이 기능에 모두. 이에 따라 $search
& $replace
에 추가하십시오.
function replaceTemplateVars($text){
global $cfg;
$dept = $this->getDept();
$staff= $this->getStaff();
$search = array('/%id/','/%ticket/','/%email/','/%name/','/%subject/','/%topic/','/%phone/','/%status/','/%priority/',
'/%dept/','/%assigned_staff/','/%createdate/','/%duedate/','/%closedate/','/%url/');
$replace = array($this->getId(),
$this->getExtId(),
$this->getEmail(),
$this->getName(),
$this->getSubject(),
$this->getHelpTopic(),
$this->getPhoneNumber(),
$this->getStatus(),
$this->getPriority(),
($dept?$dept->getName():''),
($staff?$staff->getName():''),
Format::db_daydatetime($this->getCreateDate()),
Format::db_daydatetime($this->getDueDate()),
Format::db_daydatetime($this->getCloseDate()),
$cfg->getBaseUrl());
return preg_replace($search,$replace,$text);
}
안녕하세요, stackoverflow! 코드로 질문에 대답 할 때 좀 더 자세한 정보를 추가하는 것을 고려하십시오 (특히이 코드는 이미 질문에 대답하기 위해 개선하지 않고 소스 코드에서 복사 한 것 같습니다). – Gijs