Код: Выделить всё
public function create_spm($data_spm){
$templateFile = FCPATH.'upload_file/template_spm/template_spm.docx';
$phpWord = new \PhpOffice\PhpWord\PhpWord();
$template_file = $templateFile;
$template_processor = new \PhpOffice\PhpWord\TemplateProcessor($template_file);
$template_processor->setValues($data_spm);
$output_file = FCPATH.'upload_file/spm/spm.docx';
$hasil=$template_processor->saveAs($output_file);
var_dump($hasil);
exit();
}
Я пытался поймать возвращаемое значение $ template_processor-> saveas () Но всегда возвращает null
Подробнее здесь: https://stackoverflow.com/questions/755 ... turn-value