Download the PHP package wrklst/docxmustache without Composer

On this page you can find all versions of the php package wrklst/docxmustache. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

All versions of docxmustache with dependencies

Informations about the package docxmustache

DocxMutache Logo

DocxMustache for Laravel 6.0.

StyleCI

Docx template manipulation class for Laravel 6.0, based on mustache templating language. This class is still under heavy development and works more like proof of concept at the moment. Things will change quickly and might break things.

Template Example in Word This package helps you to use docx files with mustache syntax as templates to merge richly styled documents with information from any data source. It can replace text and images and supports basic html styling (bold, itallic, underline).

Installation

composer require wrklst/docxmustache

Please check depencies down below and examples folder for configuration and usage.

HTML conversion

Current HTML conversion is basic and only supports singular runs of bold, italic and underlined text and no combination of these. It requires all values non html to be escaped with htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); and a prefix of *[[DONOTESCAPE]]* so the class knows not to escape the html before it is converted to openXML.

Replacing images

The image needs to be a reachable URL with a image in a supported format. The url value needs to be placed into the alt text description field of the image. Images will be resampled to the constraints of the placeholder image. The Image value needs to be formated the with pseudo tags around, such as: [IMG-REPLACE]http://placehold.it/350x150[/IMG-REPLACE]

Example

Please also checkout the example in the example folder to get a basic understand of how to use this class.

DOCX to PDF conversion

Conversion to PDF requires libreoffice-common to be installed on the server (used for conversion). Use sudo apt install libreoffice-common on your ubuntu/debian based server. Also install ttf-mscorefonts if you need support for Arial font when converting docx documents to pdf sudo apt-get install ttf-mscorefonts-installer

Other Dependencies

The package is dependent on several Laravel specific functions. It could easily be ported to other frameworks or be ported to be framework agnostic. In addition to the Laravel dependency, the page uses the following packages:

Laravel specific dependencies (only relevant if ported into non Laravel environment):

Contributions

If you would like to contribute something to this package, please feel free to make a pull request and a corresponding issue and we will be happy to review and discuss.

Why another openXML / docx template solution?

There are some classes out there that help with writing and or changing the content of word documents, some with commercial licenses and some free. For our particular purpose we did not need most of the features many of the libraries out there have – we needed a simple solution that would allow to replace values and images and traverse through data in a easy and straightforward manner.

Many of the other libraries use cloning to repeat a block with some custom templating syntax instead of using a existing template syntax. We use the usual mustache syntax, also to achieve repeating content in as many dimensions as needed.

Other PHP Classes to manipulate openXML word documents:


Version
Requires php Version >=7.1.0
mustache/mustache Version ^2.12
intervention/image Version ^2.5
wrklst/zipper Version ^1.0

The package wrklst/docxmustache contains the following files

Loading the files please wait ....