Forum


Replies: 6   Views: 896
Using cloneblock to clone elements
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by philip0908  · 10-05-2022 - 16:17

Looks like I don't even need to clone the word content. Using replaceTableVariable with an Array clones the content already. Is that intended?

$data = array(
  array(
   'contact_person_name' => 'Name A',
   'contact_person_email' => 'email1@email.com',
   'contact_person_mobile' => '000001',
  ),
  array(
   'contact_person_name' => 'Name B',
   'contact_person_email' => 'email2@email.com',
   'contact_person_mobile' => '000002',
  ),
);
                                                
$word_object->getFrameworkObject()->replaceTableVariable($data, array('parseLineBreaks' => true));