leonid-slv/php-rtf-template
Composer 安装命令:
composer require leonid-slv/php-rtf-template
包简介
Simple library for working with templates. Works on any PHP version, no additional libraries or dependencies are used. RTF files can be used from under any text editor, including MS Word. Supported formats UTF-8 and CP1251.
README 文档
README
Simple library for working with templates. Works on any PHP version, no additional libraries or dependencies are used. RTF files can be used from under any text editor, including MS Word. Supported formats UTF-8 and CP1251.
The library looks for the text in the [template] view and replaces it with a value.
Examples:
More examples can be found in the /Examples
Simple easy example:
$rtf = '{\rtf1\ansi\ansicpg1251\deff0\nouicompat\deflang1049{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset204 Calibri;}}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs22\lang1033 Hello\f1\lang1049 \f0\lang1033 [template], my name PHP RTF Template!\lang9\par
}
';
$rtf = rtf_easy_replace($rtf,'template','world');
Normal replace:
$rtf = '{\rtf1\ansi\ansicpg1251\deff0\nouicompat\deflang1049{\fonttbl{\f0\fnil\fcharset0 Calibri;}{\f1\fnil\fcharset204 Calibri;}}
{\*\generator Riched20 10.0.19041}\viewkind4\uc1
\pard\sa200\sl276\slmult1\f0\fs22\lang1033 Hello\f1\lang1049 \f0\lang1033 [template], my name PHP RTF Template!\lang9\par
}
';
$template = rtf2template($data);
foreach ($template as $value)
{
if (rtf_compare('template','world')
{
$template = str_replace('['.'template'.']',text2rtf('world'),$rtf);
}
}
About:
*@Author Selvistrovich Leonid
*@Mail crack-it@yandex.com
@version 1.0, 02.12.2020
leonid-slv/php-rtf-template 适用场景与选型建议
leonid-slv/php-rtf-template 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.64k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 12 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 leonid-slv/php-rtf-template 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 leonid-slv/php-rtf-template 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 1.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 18
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2020-12-02