Questions tagged [tinybutstrong]

TinyButStrong is a template engine for PHP.

TinyButStrong is a template engine for PHP. It can merge not only HTML, but also XML, text, and any textual source by the technical of template. Provided in a single file, TinyButStrong is a brick in your application, and can be inserted in any framework. It can thus cover only one feature or being a central component of your application.

TinyButStrong can be empowered by the plug-in OpenTBS in order to merge OpenOffice, LibreOffice and Microsoft Office documents.

159 questions
5
votes
1 answer

How to check if a boolean variable is 1/true or 0/false with TinyButStrong?

I'm kinda new with TinyButStrong, and I would like to know how I can check if a boolean variable is 0 or 1 ? For example, I have this: $TBS->MergeBlock('tests', $tests); And $tests have a variable call 'activated' which is a boolean. So, in my…
NH3
  • 189
  • 2
  • 12
4
votes
2 answers

Mergeing / modifying hyperlinks in openTBS

I've been trying to make links work in openTBS generated documents. No luck so far :( What I can do: With a bit of a hack, I can create a template with a link, and change the link caption and the href by my variables. What I can not do: Create a…
Mihaly KR
  • 2,363
  • 2
  • 19
  • 20
3
votes
1 answer

CakePHP + TinyButStrong

Anyone tried using TinyButStrong together with CakePHP? I have no prior knowledge of TinyButStrong but seems to be a good way to generate Word documents from templates. But I am not sure how to integrate this with a CakePHP application. Thank you…
gt10001
  • 182
  • 2
  • 13
3
votes
0 answers

Changed formation while use character limit in TBS library

I fetch description from database(MySql). I store the description in html format. When i display description with char limit it cut some tag so the formation is change. So any idea how can i fix this problem. In database description is store…
David Coder
  • 1,138
  • 2
  • 14
  • 48
3
votes
1 answer

Conditional show text block in .docx using OpenTBS based on variable value

In my project I use TinyButStrong / OpenTBS to generate Word documents from templates. First I load a variable like myuser in the document. [onload;tplvars;myuser=user] The document is provided with the required variables, so I can add tags like…
nielsr
  • 2,417
  • 2
  • 15
  • 16
2
votes
1 answer

How do I merge multiple Excel documents using Tiny But Strong's Excel plug in?

I am currently using TinyButStrong's Excel plugin to create numerous Excel docs that are sent out on a scheduled basis. I have been requested to break the information into separate worksheets, within a single Excel document, where each report could…
2
votes
3 answers

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…
James
  • 63
  • 7
2
votes
1 answer

Enable modification of file using OpenTBS

I have some difficulties with OpenTBS. I use it to load a template and permit the user to modify this template and save it on the server after modification. When i use $TBS->Show(OPENTBS_DOWNLOAD,$file_name) it opens the file template but save it in…
Vens
  • 21
  • 3
2
votes
1 answer

OpenTBS Replace Text

Is it possible to replace text without having to create a TAG? I'm using a template to fill some data in a word document. One of the things I need to fill is the revision number, something like: "1º Revision" ([onshow.rev]) But the generated file…
jorgemfm
  • 23
  • 4
2
votes
1 answer

OpenTBS Word Document hide table

I am using TBS to create an MS Word Document from a template in PHP and trying to remove a table depending on a boolean variable. What I'm trying to do is similar to the following code, but I want to remove a table rather than an…
Dan
  • 1,447
  • 2
  • 14
  • 30
2
votes
2 answers

OpenTBS and Special Characters (PHP)

I'm using OpenTBS to modify word templates from PHP. Basically I need to update strings in a word document from values that I have in a MySQL database. It is working well, however when I have special characters such as é, à, ô, it outputs a sequence…
Mart Coul
  • 490
  • 6
  • 15
1
vote
1 answer

PHP: spreadsheet summary with OpenTBS?

I'm using the PHP library TinyButStrong with the plugin OpenTBS to merge existing Excel (or OpenOffice Calc) spreadsheets with data from a database. This works fine, but I can't figure out how to define summaries for a column. For example , I define…
Dylan
  • 9,129
  • 20
  • 96
  • 153
1
vote
1 answer

Can't load a .doc extension file with TBS/OPENTBS

I'm trying to load a .doc file (MS WORD 2007) with only Office. But I've a pop-up asking me the encoding type. What is happening is that the template can't be loaded with errMsg. But if I edit the file with only Office and then try to load it, it…
1
vote
1 answer

"The file 'file.odt' is corrupt and therefore cannot be opened." when change picture using OpenTBS

I'm testing the OpenTBS library to use it to generate a document in my project. I created a .odt file in LibreOffice with the image as stated in the documentation and other posts on StackOverflow. However, when I change the image, after saving the…
ciastekkkk
  • 89
  • 7
1
vote
0 answers

Error when changing an image using TBS/openTBS

I'm trying to use tbs/opentbs with PHP to switch out an image in my docx file. I'm using TBS 3.14.0 OpenTBS 1.10.0 PHP 7.2.5 The docx file does download. When I open it using MS Word 2021 I get the following message: Word found unreadable content…
1
2 3
10 11