PHPackages                             activecollab/templatedui - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. activecollab/templatedui

ActiveLibrary

activecollab/templatedui
========================

Library for building web interfaces using templates, on the backend.

0500PHP

Since Mar 2Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/activecollab/templatedui)[ Packagist](https://packagist.org/packages/activecollab/templatedui)[ RSS](/packages/activecollab-templatedui/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Templated UI
============

[](#templated-ui)

Experimental library for building interfaces using templates, on the backend.

Basic Elements
--------------

[](#basic-elements)

Templated UI builds on top of Smarty syntax and provides a more convenient way to extend it. Unlike recommended way to build extensions, as functions, Templated UI extensions are built as classes with following goals in mind:

1. **Composability** - Use all the PHP's object features to compose your extensions: inheritance, interfaces, traits, encapsulation etc,
2. **Strict Types** - Use PHP's type system to ensure that your extensions are used correctly, with centralized type checking,
3. **Dependency Injection Ready** - Provide all dependencies as constructor arguments,
4. **Easy to Test, and Refactor** - Use standard refactorings and testing tools to work with your extensions.

There are three types of extensions that Templated UI provides out of the box:

1. **Tags** - Similar to function calls, or HTML's self-closing elements, they have a name, and accept any number of arguments,
2. **Blocks** - Blocks are similar to tags, but they can have content, and they can be nested,
3. **Modifiers** - Modifiers are used to modify the output of variables. For example, you can output dates in different formats, or escape HTML.

Tags are commonly used as functions, that receive a number of arguments, and output some HTML. We can define a tag by extending `Tag` class:

```
