Skip to content

Instantly share code, notes, and snippets.

@adnan360
Created February 13, 2018 10:58
Show Gist options
  • Save adnan360/b838508398993c0ae6c2d02cf5ba3319 to your computer and use it in GitHub Desktop.
Save adnan360/b838508398993c0ae6c2d02cf5ba3319 to your computer and use it in GitHub Desktop.
require_once( dirname( MPLUS_CE ) . '/vendor/PHPWord/Template.php' );
class Mplus_PHPWord_Template extends PHPWord_Template
{
private $page_xml;
public function __construct( $strFilename ){
parent::__construct( $strFilename );
$this->page_xml = file_get_contents(dirname( MPLUS_CE ) . '/assets/page.txt');
}
public function add_page(){
$this->_documentXML = str_replace("<!--page-->", $this->page_xml, $this->_documentXML);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment