What is the return value of $template_processor->saveAs()
? , i tried to catch the return value to determine whether the process is successfully executed or not
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();
}
It's always return NULL
I've tried to catch the return value of $template_processor->saveAs() but it's always returning NULL