A TYPO3 template engine based on plain PHP files
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Joshua Westerheide b7428cb769
docs: add installation section
4 years ago
.ddev init: setup development environment 4 years ago
Classes feat: implement automatic template debugging 4 years ago
Resources/Private/Examples feat: implement menu helper function 4 years ago
.gitignore chore: remove composer.lock 4 years ago
LICENSE docs: add license 4 years ago
README.md docs: add installation section 4 years ago
composer.json feat: implement automatic template debugging 4 years ago
ext_emconf.php init: create TYPO3 extension 4 years ago
ext_localconf.php feat: implement basic PHPTemplate rendering 4 years ago
functions.php feat: add standalone functions to Rendering\Context namespace 4 years ago

README.md

TYPO3 PHPTEMPLATES

PHPTEMPLATES is a TYPO3 extension which implements a simple template rendering engine based on plain PHP files. It can be used alongside the well-known Fluid template engine or as a replacement for it.

Installation

At the moment the only way to install this extension is through Composer:

composer require jdoubleu/typo3-phptemplates

State of Development

WARNING: This extension/template engine is still under development. The API may be subject to breaking changes in the future. As this is an experimental template engine the internals may also change. If you have any suggestions, critic or use cases please feel free to share them.

Motivation

Following some criticism about the complexity of Fluid templates and limitations by the template engine itself, I wanted to implement a simple-as-possible template engine while still providing enough features for general page rendering. In fact, PHPTEMPLATES only implement a template resolving and overriding mechanism as well as a minimal and easy to learn API to interact with certain TYPO3 internals (e.g. TypoScript, ContentElements, etc.).

This template engine is meant to be opinionated and thought to work only a specific way, although it is possible to extend the internals and behaviour.

Features

  • Easy to learn: You only need to know PHP itself, a minimal (~5 LOC) initial configuration and a small and simple API
  • Fast: Since we are using PHP files already we don't need to render any template files back to PHP. However this might only affect development time, because templates are cached in production.
  • Flexibility: You can write any PHP code and logic inside the templates and don't need to know how to write ViewHelper for example.
  • Easy debuggable: You can either use PHP's built-in echo, print, var_dump, etc. functions or use XDebug and set breakpoints directly in your template files.

Given the features, the developer is still responsible for writing clean code, meaning to not blow up templates and separate business logic from presentation.

Documentation

TODO

Examples

As long as there is no official documentation, follow the examples in Resources/Private/Examples.

License

GPLv3