定制 tyz910/docx-templates 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

tyz910/docx-templates

最新稳定版本:0.9.1

Composer 安装命令:

composer require tyz910/docx-templates

包简介

Simple template engine for .docx

README 文档

README

Latest Stable Version Build Status Coverage Status Scrutinizer Quality Score

You can create a .docx template file with included search-patterns that can be replaced by any value you wish:

<?php
use DocxTemplate\TemplateFactory;

$template = TemplateFactory::load('template1.docx');
$template->assign([
    'name'    => 'Jon',
    'surname' => 'Snow',
    'house'   => 'Stark'
]);
$template->save('jon.docx');

Search-pattern spelling

Default search-pattern spelling is: {{mark_name}}
Mark name should be lowercase, with words separated by underscores.

My name is {{name}}.

Also you can use any search-pattern spelling you wish:

<?php
use DocxTemplate\TemplateFactory;

TemplateFactory::useMarkSyntax('${', '}'); // prefix and suffix
$template = TemplateFactory::load('template.docx');

Installation using Composer

Add to your composer.json:

{
    "require" :  {
        "tyz910/docx-templates": "*"
    }
}

统计信息

  • 总下载量: 34.89k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 22
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 20
  • Watchers: 2
  • Forks: 6
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-06-29