http://www.tinybutstrong.com/plugins/opentbs/demo/demo.htmlを使用していますが、うまく動作しません。私の .docx には実際の単語の差し込み印刷フィールドがあります。ドキュメントを理解しようとしてきましたが、そこから得られるのは、PHP デモ コードが $your_name を宣言しているように見え、.docx の onshow.your_name を魔法のように置き換えていることだけです。
最初の例では、$data の配列で MergeBlock を使用したと思いました。これまでの私のコードは次のとおりです。
$TBS = new clsTinyButStrong;
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
$template = $_SERVER['DOCUMENT_ROOT'] . '/inc/dd.docx';
$data = array();
$data[] = array('ContactName'=>$this->title . ' ' . $this->firstname . ' ' . $this->surname,
'Address1'=>$this->address1,
'Address2'=>$this->address2,
'Address3'=>$this->town,
'Address4'=>$this->county,
'PostalCode'=>$this->postcode,
'Bacsref'=>$this->bb_number,
'Account_Name'=>$this->ac_name,
'SortCode'=>$this->CorrectedSortCode,
'Account_Number'=>$this->CorrectedAccountNumber);
$ContactName = $this->title . ' ' . $this->firstname . ' ' . $this->surname;
$TBS->LoadTemplate($template);
$TBS->MergeBlock('a,b', $data);
$file_name = $this->bb_number . ' Direct Debit';
//$TBS->Plugin(OPENTBS_DEBUG_XML_CURRENT);
$TBS->Show(OPENTBS_DOWNLOAD, $file_name . '.docx');
ダウンロードしたファイルでは、差し込み印刷フィールドが置き換えられていません。デモからは、本当の単語の差し込み印刷フィールドのようには見えない onshow.your_name がどのように置き換えられているか推測できません。私が見るのは、$your_name を判別するためのエラー チェック コードだけです...