PHPackages                             alexoliverwd/brace - 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. [Templating &amp; Views](/categories/templating)
4. /
5. alexoliverwd/brace

ActiveLibrary[Templating &amp; Views](/categories/templating)

alexoliverwd/brace
==================

A simple template language written in PHP

v1.1.2(2mo ago)13.6k↓50%1MITPHPPHP &gt;=8.4CI passing

Since Sep 16Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/aoliverwd/brace)[ Packagist](https://packagist.org/packages/alexoliverwd/brace)[ RSS](/packages/alexoliverwd-brace/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (43)Used By (1)

[![PHPUnit](https://github.com/aoliverwd/brace/actions/workflows/ci.yml/badge.svg)](https://github.com/aoliverwd/brace/actions/workflows/ci.yml/badge.svg) [![Latest Stable Version](https://camo.githubusercontent.com/71a8df006540cfe2eb3cbcc31be9723a3bb9e6f98ce2f2a8c39fbbc56a8ea243/68747470733a2f2f706f7365722e707567782e6f72672f616c65786f6c6976657277642f62726163652f76)](//packagist.org/packages/alexoliverwd/brace) [![License](https://camo.githubusercontent.com/d3065fbe9b89372fd1595124520bc52a2691d4a1338649f5b6395c9e9696936c/68747470733a2f2f706f7365722e707567782e6f72672f616c65786f6c6976657277642f62726163652f6c6963656e7365)](//packagist.org/packages/alexoliverwd/brace)

Brace
=====

[](#brace)

brace is a simple template language written in PHP. Brace uses a handlebar style syntax.

- Requirements
- Installation
    - Via composer
    - Or Including the brace class
- Usage
    - Returning processes templates as a string
    - Compiling to an external file
    - Instance variables
- Template Reference
    - Variables
        - In-line "or" operator
        - Multiple In-line "or" operators
        - Return variable values by an array index value
    - Iterators
        - In-line Iterators
    - Nth children
    - Row keys
    - Iteration data variables
    - Loops
        - Increasing
        - Decreasing
    - Loop data variables
    - Conditional Statements
        - Condition Blocks
    - Else If Statements
        - In-line conditions
        - Conditions
    - Including Templates
    - Shortcodes
        - PHP Implementation Example
        - Content Template
    - Array Counting
        - Display Count:
        - Check Count
    - Comment Blocks
        - In-line Comment Block
        - Multiple Line Comment Block
    - Clearing cached process string
    - Running Tests

Requirements
============

[](#requirements)

Brace requires PHP version 8.1 or later.

Installation
============

[](#installation)

Via composer
------------

[](#via-composer)

```
composer require alexoliverwd/brace

```

Or Including the brace class
----------------------------

[](#or-including-the-brace-class)

```
/** Include brace */
include __DIR__.'/src/brace.php';
```

Usage
=====

[](#usage)

```
