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()
117117 /**
118118 * Save Template
119119 *
120- * @param string $strFilename
120+ * @return string
121121 */
122- public function save ($ strFilename )
123- {
124- if (file_exists ($ strFilename )) {
125- unlink ($ strFilename );
126- }
127-
122+ public function save () {
128123 $ this ->_objZip ->addFromString ('word/document.xml ' , $ this ->_documentXML );
129124
130125 // Close zip file
131126 if ($ this ->_objZip ->close () === false ) {
132127 throw new Exception ('Could not close zip file. ' );
133128 }
134129
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 );
136146 }
137- }
147+ }
You can’t perform that action at this time.
0 commit comments