コード例 #1
0
ファイル: Template.php プロジェクト: tyz910/docx-templates
 /**
  * @param string $filePath
  */
 public function save($filePath = null)
 {
     foreach ($this->docContents as $uri => $docContent) {
         $this->doc->setContent($docContent->getContent(), $uri);
     }
     $this->doc->save($filePath);
 }
コード例 #2
0
 public function testSave()
 {
     $doc = new Document($this->getFixturePath('test.docx'));
     $doc->setContent(file_get_contents($this->getFixturePath('simple_document.xml')));
     $doc->save($this->getRuntimePath('new.docx'));
     $this->assertFileExists($this->getRuntimePath('new.docx'));
 }