Templating

Introduction to the Template Interface

Cement defines a Template Interfacearrow-up-right, as well as a default DummyTemplateHandlerarrow-up-right that implements the interface as a placeholder but does not actually do anything.

circle-exclamation

****

Cement Extensions That Provide Template Handlers:

API References:

Configuration

Application Meta Options

The following options under App.Metaarrow-up-right modify configuration handling:

Option

Description

template_handler

The handler that implements the template interface.

Working with Templates

The template handler can be used to render content in-line, as well as copy render source directories before copying them to their destination.

circle-info

When copying a source directory, both the file/directory path names themselves are rendered as templates as well as the contents of files.

Creating a Template Handler

All interfaces in Cement can be overridden with your own implementation. This can be done either by sub-classing TemplateHandlerarrow-up-right itself, or by sub-classing an existing extension's handlers in order to alter their functionality.

Last updated