Skip to content

Commit

Permalink
HACK implementation of PHPOffice#260
Browse files Browse the repository at this point in the history
  • Loading branch information
jdespatis committed Jun 9, 2014
1 parent 38d3d7b commit c66dc62
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/PhpWord/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,27 @@ public function applyXslStyleSheet(&$xslDOMDocument, $xslOptions = array(), $xsl
$this->documentXML = $xmlTransformed;
}

/**
* Set a new image
*
* @param string $search
* @param string $replace
*/
public function setImageValue($search, $replace)
{
// Sanity check
if (!file_exists($replace))
{
return;
}

// Delete current image
$this->zipClass->deleteName('word/media/' . $search);

// Add a new one
$this->zipClass->addFile($replace, 'word/media/' . $search);
}

/**
* Set a Template value
*
Expand Down

0 comments on commit c66dc62

Please sign in to comment.