Skip to content

Commit ad47f39

Browse files
author
Mark Baker
committed
Merge pull request #7 from SergeC/patch-1
Update src/PHPWord/Template.php
2 parents db59063 + 9d6b2ff commit ad47f39

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/PHPWord/Template.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,14 @@ public function setValue($search, $replace) {
9191

9292
$this->_documentXML = str_replace($search, $replace, $this->_documentXML);
9393
}
94-
94+
/**
95+
* Returns array of all variables in template
96+
*/
97+
public function getVariables()
98+
{
99+
preg_match_all('/\$\{(.*?)}/i', $this->_documentXML, $matches);
100+
return $matches[1];
101+
}
95102
/**
96103
* Save Template
97104
*

0 commit comments

Comments
 (0)