direct808/docxerator
Composer 安装命令:
composer require direct808/docxerator
包简介
Simple MS Word DOCX template processor
README 文档
README
Docxerator is a simple MS Word DOCX template processor
Features
- Customizing the label templates
- Processing of fragmented labels
Requirements
- PHP version 5.6 or higher
- XML extension
- MBString extension
Install with composer
To install with Composer, simply require the latest version of this package.
composer require direct808/docxerator
Make sure that the autoload file from Composer is loaded.
// somewhere early in your project's loading, require the Composer autoloader // see: http://getcomposer.org/doc/00-intro.md require 'vendor/autoload.php';
Usage
Docxerator is very easy to use:
// reference the Docxerator namespace use Direct808\Docxerator\Docxerator; // instantiate and use the Docxerator class $docxerator = new Docxerator(); // open docx template file (contains the label #MARK#) $docxerator->open('./you_docx_document.docx'); // Replace the label $docxerator->replace('MARK', 'Your replaced content'); // Save the processing document $processingDocumentPath = $docxerator->save();
Custom label format
$docxerator = new Docxerator(); // Docxerator will processing labels of the format {MARK} $docxerator->setMarkPattern('/\{(\w+)\}/i'); $docxerator->open('./you_docx_document.docx'); $processingDocumentPath = $docxerator->save();
统计信息
- 总下载量: 47
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-20