File tree Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Expand file tree Collapse file tree 1 file changed +19
-9
lines changed Original file line number Diff line number Diff line change @@ -117,21 +117,31 @@ public function getVariables()
117
117
/**
118
118
* Save Template
119
119
*
120
- * @param string $strFilename
120
+ * @return string
121
121
*/
122
- public function save ($ strFilename )
123
- {
124
- if (file_exists ($ strFilename )) {
125
- unlink ($ strFilename );
126
- }
127
-
122
+ public function save () {
128
123
$ this ->_objZip ->addFromString ('word/document.xml ' , $ this ->_documentXML );
129
124
130
125
// Close zip file
131
126
if ($ this ->_objZip ->close () === false ) {
132
127
throw new Exception ('Could not close zip file. ' );
133
128
}
134
129
135
- rename ($ this ->_tempFileName , $ strFilename );
130
+ return $ this ->_tempFileName ;
131
+ }
132
+
133
+ /**
134
+ * Save Template As...
135
+ *
136
+ * @param string $strFilename
137
+ */
138
+ public function saveAs ($ strFilename ) {
139
+ $ tempFilename = $ this ->save ();
140
+
141
+ if (file_exists ($ strFilename )) {
142
+ unlink ($ strFilename );
143
+ }
144
+
145
+ rename ($ tempFilename , $ strFilename );
136
146
}
137
- }
147
+ }
You can’t perform that action at this time.
0 commit comments