replace() public static method

public static replace ( $text, $patient )
 /**
  * Ajax action to expand shortcodes in letter string for a patient.
  *
  * @throws Exception
  */
 public function actionExpandStrings()
 {
     if (!($patient = Patient::model()->findByPk(@$_POST['patient_id']))) {
         throw new Exception('Patient not found: ' . @$_POST['patient_id']);
     }
     $text = @$_POST['text'];
     $textNew = OphCoCorrespondence_Substitution::replace($text, $patient);
     if ($text != $textNew) {
         echo $textNew;
     }
 }
Beispiel #2
0
 public function substitute($patient)
 {
     $this->body = OphCoCorrespondence_Substitution::replace($this->body, $patient);
 }