问题标签 [tinybutstrong]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
php - TinyButStrong 如何使用块与 php var 比较数据值?
环境:PHP 5.3.5 MySQL 服务器 5.5.8
之前使用的是 TBS 3.7.0 现在使用的是 TBS 3.8.2
在我合并到 TBS (TinyButStrong) 的 sql 数据集中,我有一个发件人/收件人信息。我想显示当前不是用户的那个。我无法让 TBS IF THEN 语句正常工作。
在php中
在 html 中,名字没有被填充,而姓氏是因为我只是直接请求该值,即使它可能是不正确的值。
我一直在搜索和阅读 TBS 手册,但是使用 if / else with blocks 的例子不是这样的。
有人可以帮我看看我做错了什么吗?
目前我的输出如下所示:
当我只想输出简时。
php - 如何根据用户的角色隐藏/删除侧面导航栏中的选项?(最佳实践)
环境:PHP/5.5.6
我为侧面导航栏定义了 2 个 *.html 文件,一个用于角色 A,一个用于角色 B。两者之间有相似之处,我想将相似之处合并到一个文件中,并包含不同的选项基于角色,当用户登录时。
IE:
- 侧导航栏有 5 个选项。选项 1 至选项 5。
- 角色 A 有权访问选项 1 - 选项 4。
- 角色 B 有权访问选项 1 - 选项 3 和选项 5。
当前用户登录时,调用的文件基于用户的角色,但如果角色被扩展,则每个角色都需要另一个文件。我不喜欢这种方法,因为它很臃肿,有时一个简单的更改会导致多个文件的更改 - 不好玩也不好看。
我考虑过将所有选项放在一个文件中,并使用 CSS display:block 或 :none 以及 javascript / jquery 向用户显示所需的功能。我不知道这是否是最好的方法。即使项目不可见,如果查看源代码,这些选项的 html 也是可见的。
我还考虑过 TinyButStrong 根据用户的角色将元素添加到列表中,并且该元素将包含在它自己的文件中。我不确定这种方法将如何工作,因为我正在寻找合并(添加)侧导航菜单上的单个项目。目前我正在使用 TBS 来包含整个 div 而不是单个元素,如下所述。
即侧导航选项html文件包含
基础侧导航 *html
哪种方法是最好的,或者我应该用另一种方法来解决这个问题?如果上述方法不好,为什么?
希望有人能在这个时候帮助和/或指导我。
php - 启用使用 OpenTBS 修改文件
我在使用 OpenTBS 时遇到了一些困难。我用它来加载一个模板并允许用户修改这个模板并在修改后将它保存在服务器上。
当我使用$TBS->Show(OPENTBS_DOWNLOAD,$file_name)
它时,它会打开文件模板,但将其保存在临时文件(客户端)中。但我想把它保存在服务器上。
如果我使用 $TBS->Show(OPENTBS_FILE, $file_name)
该文件将保存在服务器上,但修改不会。
如何将文件保存在服务器上并让用户可以直接在服务器上修改它?
php - TinyButStrong PHP 模板化多列表
我正在使用 TBS 示例代码:
但不是如下的单列表
我想获得一个多列(例如 4 列)表。
到目前为止,我发现的唯一有效代码是:
并作为模板
有没有更简单的?
php - 如何用openTBS合并一页上的多个标签?
我想知道在一个页面上处理多个合并的最佳方法是什么。像这样一个官方的 avery 地址标签模板:
我的目标是为地址标签创建一个 docx 模板,然后使用 openTBS 对其进行处理,以便每个数据库地址行都以一个新的标签字段结束,但不一定是一个新页面。
我在理解如何实现这一点时遇到了很多问题。
这可以通过类似于分页符的方式在模板内完成,因此无需额外的 php 关注吗?
或者它是否需要更多的 php 关注,我的意思是为一个页面上的每个标签设计一个单独的块,然后是一个分页符。然后在 php 方面,我需要知道模板中有多少块,并为每个块分配一个合并块。
如果只有后一种方法有效,是否有一种简单的方法来解析模板并找出其中存在多少块?
php - How to insert conditional spaces in docx with opentbs (only if certain fields are not blank)
I am using opentbs to generate reports in .docx format from data entered by users into a form, and would like to be able to add spaces between fields conditionally. Here's the paradigm example of the issue: The user must enter a street address (address1), but the fields immediately before and after the address field (business and address2, respectively) are optional. Is there a way to set up the merge fields in the template so that, if the user puts something into the business field, the document resulting from the merge will have the value of the business field followed by a space, but if the user leaves the field blank, the document resulting from the merge will not have either the field or the space? I can see two possible ways of achieving this: 1. using a stand-alone merge field that prints a space only if the field "business" is not blank; or 2. using a merge field in the template that prints both the value of the field and a space, but only if the field is not blank.
Here's my psuedocode for these two solutions: 1. [onshow.business][onshow;if[business]!=blank;then' ';else''][onshow.address1] 2. [onshow.business AND ' '][onshow.address1]
It seems like this must be possible, and yet I haven't been able to find a way to turn either pseudocode into real, functioning merge fields in my docx. template. I've searched all of the entries on this forum and on the tbs forum, as well as the documentation, but the issue hasn't squarely been raised, and the things I have tried have not worked. Any help would be much appreciated.
symfony - 如何获取 TinyButStrong 生成的文件处理程序
我会链接到发送 TinyButStrong 使用 Swiftmailer 生成的 .odt 文件。这是 mu 当前代码
我已附上文件,但无法使用 LibreOffice 打开文件。
那么有没有办法让正确的文件处理程序能够稍后将其附加到我的电子邮件中?任何帮助表示赞赏。谢谢
php - docx中的opentbs条件语句
如何显示和隐藏标签 [Merk - Track - Type || 位置 - 证书],所以这里是:当我有车辆数据时,数据会出现:
和土地数据数据不出现,否则。
我的完整代码:
之前谢谢。
docx - 使用基于变量值的 OpenTBS 在 .docx 中条件显示文本块
在我的项目中,我使用 TinyButStrong / OpenTBS 从模板生成 Word 文档。首先,我myuser
在文档中加载一个变量。
该文档提供了所需的变量,因此我可以在将名称放置在变量上的位置添加如下标签:
条件值也可以正常工作:
但是当我有多个要显示/隐藏的段落时,选择正确的段落(或更改模板并添加段落)并不容易。是否可以创建具有基于值显示的“开始”和“结束”的块?像这样的东西(伪代码):
我在 TBS/OpenTBS 文档中找不到任何这些。有人知道这样做的方法吗?
谢谢!
尼尔斯
php - 如何使用 Open TBS 在 Word 文档中插入欧元符号?
我正在使用 Tinybutstrong 的 Open TBS 插件创建一个合并的 word 文档,但是当从 php 变量合并时,我无法让它正确显示欧元符号。
我努力了:
- 在我的变量中直接输入字符为“€”
- 使用 html 实体名称/代码
- 在 word 中使用自动完成将代码转换为符号
这些都不能正确显示,有没有人遇到/能够解决这个问题?