Download the PHP package waltdietzney/odt-template-engine without Composer

On this page you can find all versions of the php package waltdietzney/odt-template-engine. 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?

Informations about the package odt-template-engine

ODT Template Engine

Generate real, editable OpenDocument Text (.odt) files from PHP.

ODT Template Engine is an open-source PHP library for working with LibreOffice-authored ODT templates, PHP-generated native ODT content, and named Writer structures while keeping the result editable as a real ODT document.

CI PHP Version OpenDocument

Use familiar LibreOffice/ODT documents as templates and keep the generated result editable instead of limiting document generation to PDF output.

๐Ÿš€ Try it online

Open the live Sample Explorer โ€” inspect real PHP sample code, explore the semantic template contract and generate downloadable .odt documents directly in your browser. No installation required.

Why ODT Template Engine?

Many document-generation workflows start with HTML and end with PDF. That is useful when the final document is meant to be fixed, but it is less convenient when users need to continue editing the result in an office application.

ODT Template Engine works directly with OpenDocument Text packages. Templates can be designed in LibreOffice, populated from PHP, structurally addressed by native ODT identities, and saved again as real .odt files.

This makes the engine useful for documents such as:

Three complementary ways to work with a document

The engine is not limited to one templating model.

1. Simple Template Processing

Use visible expressions for scalar values, filters, conditions, and lightweight loops:

2. Structured ODT Construction

When PHP owns a dynamic region's internal structure, build native ODT elements such as RichText, Paragraph, ListElement, RichTable, and ImageElement, then insert them into a template placeholder.

3. Writer-native Document Model

When LibreOffice should own the structure, address native named document objects directly:

Named Sections and Bookmarks expose bounded native operations; Writer-owned tables support bounded row population; named frames expose typed identity/inspection and participate in the separately validated mapped image-replacement workflow. Writer User Fields provide native document-global string bindings.

These models can coexist in one document. The important design choice is who owns the structure: the template or PHP?

Features

Requirements

The automated test suite currently runs on PHP 8.2, 8.3 and 8.4.

LibreOffice is used to author normal ODT templates and is recommended for visual verification of generated documents. It is not a PHP runtime dependency of the engine.

Installation

Install the package with Composer:

For development or to explore the repository locally:

Quick start

Create an ODT document in LibreOffice and place placeholders such as these in the document:

Then populate the template from PHP:

OdtTemplate loads the source document during construction. After all values and repeating data have been assigned, render() applies the template logic and save() writes the resulting ODT package. save() does not implicitly call render().

The result is a normal ODT document that can be opened and edited in LibreOffice and other compatible OpenDocument applications.

Rich document elements

The template language is only one part of the engine. More complex document content can be constructed with ODT-aware elements.

For reusable named paragraph styles in the current document, use the document-style facade:

The repository also contains elements and helpers for tables, table cells, images, lists and HTML imports.

Native structured templates

LibreOffice-authored structure can also remain the source of truth for repeatable blocks.

Each returned SectionTarget represents the generated native section and can address nested section prototypes relative to its own subtree. This allows application data to drive collections without rebuilding the visual block in PHP.

Use inspect() when you need an immutable snapshot of the native named sections, bookmarks, tables, frames, and diagnostics present in the current document.

Native Writer User Fields

For LibreOffice-authored document-global string values, use Writer User Fields:

The engine updates the authoritative User Field declarations in the working ODT. Cached field display text is left to Writer reevaluation.

This is intentionally separate from classic {{customer}} placeholder assignment. The 1.0 Writer User Field API is bounded to string User Fields; broader native field types are outside this contract.

Interactive samples

Want to see what the engine actually produces before installing it? Try the live Sample Explorer. You can open the PHP source behind each example, inspect the semantic template contract and generate the real editable ODT output yourself.

The same Sample Explorer is included in the repository under samples/.

The canonical sample path culminates in professional ownership-focused examples:

Run the explorer locally with PHP's development server:

Then open http://localhost:8085 in your browser.

Before exposing your own Sample Explorer deployment publicly, review demo/README.md and apply appropriate server and deployment controls.

Used in real projects

ODT Template Engine is developed alongside real document-generation use cases rather than as an isolated format experiment.

Bewerbungstools.de

Bewerbungstools.de uses ODT-based document workflows for application tooling and document generation.

CV Generator

The CV Generator uses the engine as a document-rendering layer for editable CVs with structured sections, layouts, rich text, images and styles. It serves as an important real-world consumer for the engine's richer document features.

Tests and quality

Run the complete test suite with:

The suite combines focused regression tests with integration tests that generate fresh ODT files and inspect the resulting package. Integration coverage includes checks of ODT ZIP contents and XML such as content.xml, styles.xml, meta.xml and the package manifest.

GitHub Actions runs the suite against PHP 8.2, 8.3 and 8.4.

The project also uses generated sample documents for practical LibreOffice-oriented testing. Automated package tests are intended to complement, not completely replace, real office-suite compatibility checks.

Documentation

The developer documentation is published at odt.walter-dietz.de/docs/. Its versioned Markdown source lives in docs/ and is built with Zensical.

Start with the Quick Start, then choose the guide for Simple Template Processing, Structured ODT Construction, or the Writer-native Document Model. For application-shaped data and inspected template contracts, Mapping, Preflight & Automation is an optional integration workflow rather than a fourth authoring model.

For exact signatures, lifecycle rules, options, limitations, and API classifications, use the Practical API Reference. The Sample Guide explains the canonical L/C/B/S learning path.

Useful repository areas:

Security

Please report suspected vulnerabilities according to SECURITY.md. Do not publish security-sensitive reports as public issues before they have been reviewed.

Contributing

Issues, reproducible bug reports and focused pull requests are welcome. See CONTRIBUTING.md for development and contribution guidance.

Before submitting code, please install development dependencies and run:

Support the project

ODT Template Engine is free and open source. If the project is useful to you, starring the repository helps other developers discover it.

For the current voluntary support options, including PayPal and Bitcoin Lightning, visit the project support page.

Author

Created and maintained by Walter Dietz (@WaltDietzney).

License

ODT Template Engine is released under the MIT License.


All versions of odt-template-engine with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
ext-dom Version *
ext-zip Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package waltdietzney/odt-template-engine contains the following files

Loading the files please wait ...