Forum


Replies: 2   Views: 925
Cómo utilizar replacelistvariable para obtener una lista anidada
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 admin  · 13-12-2021 - 11:47

Hola,

Utilizar arrays anidados en el método replaceListVariable se permite desde el lanzamiento de phpdocx 12 (https://www.phpdocx.com/news/post/phpdocx-v12-release-notes/223):

  • replaceListVariable allows using sub-arrays.

por ejemplo:

$items = array(
  'First item',
  'Second item',
  array(
    'Subitem A',
    'Subitem B',
    'Subitem C',
    array('Subitem C.1', 'Subitem C.2'),
    'Subitem D'
  ),
 'Third item'
);

$docx->replaceListVariable('LISTVAR', $items);

Versiones anteriores de phpdocx no lo permiten. Te recomendamos actualizar tu licencia a la última versión disponible.

Saludos.