Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Docx
- {
- private $_doc;
- private $_name;
- public function __construct($template)
- {
- $this->_name = $template;
- $this->_doc = new phpdocx($template);
- }
- public function save($outFile, $params = array())
- {
- if ($outFile == $this->_name)
- {
- throw new Exception('Output file is the same as input template');
- }
- if (count($params))
- {
- foreach ($params as $key => $value)
- {
- $this->_doc->assign('#' . $key . '#', $value);
- }
- }
- $this->_doc->save($outFile);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement