diff --git a/Resources/doc/twig_tags.rst b/Resources/doc/twig_tags.rst index c8bca32..322c6c6 100644 --- a/Resources/doc/twig_tags.rst +++ b/Resources/doc/twig_tags.rst @@ -453,6 +453,7 @@ dataValidation array merge int|string X Merge a cell range. Allows zero-based cell index or cell coordinates like 'A3' style array X Standard PhpExcel style array url string X +isExplicitValue boolean X If true then render cell as an explicit value (useful to show leading zero numbers as string) ======================= ========== === === =========== Example diff --git a/Wrapper/XlsCellWrapper.php b/Wrapper/XlsCellWrapper.php index 2ab047b..f187b59 100644 --- a/Wrapper/XlsCellWrapper.php +++ b/Wrapper/XlsCellWrapper.php @@ -146,7 +146,11 @@ public function start($index = null, $value = null, array $properties = null) $this->sheetWrapper->getRow()); if ($value !== null) { - $this->object->setValue($value); + if (array_key_exists('isExplicitValue', $properties) && $properties['isExplicitValue'] === true) { + $this->object->setValueExplicit($value); + } else { + $this->object->setValue($value); + } } if ($properties !== null) {