PHPackages                             isaeken/brick-engine - 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. isaeken/brick-engine

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

isaeken/brick-engine
====================

A simple language engine for your templates.

1001PHPCI failing

Since Jan 30Pushed 1y ago2 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

BrickEngine
===========

[](#brickengine)

**BrickEngine** is a simple, flexible, and extensible script engine written in PHP.
It allows you to manage custom business rules, e-commerce discounts, automation scenarios, or any workflow you define without "changing code."

> **Status:** The project is still in development and may not yet be fully ready for production use.
> **Support Us:** If you like the project, please star it or contribute to support its development.

---

Why Choose BrickEngine?
=======================

[](#why-choose-brickengine)

Features
--------

[](#features)

- **Dynamic Scripting Language:** BrickEngine supports a wide range of operations through its flexible scripting language.
- **Easy Extensibility:** You can add your own functions (e.g., `apply_discount`, `dump`, `json_decode`) and variables to the context. All functions and variables must be explicitly defined and bound to BrickEngine.
- **API &amp; External Integrations:** Whether for e-commerce, payment systems, or microservices, you can utilize scripts to make external API calls.
- **Clean and Readable Syntax:** Easily perform conditional operations using simple `if` structures, loops, and assignments.
- **Performance and Flexibility:** Centralize and manage your business rules to avoid complex branching and if-else chains.
- **Support for Various Data Types:** Operate on different data types, such as strings, numbers, booleans, and arrays.
- **Loop and Conditional Structures:** Includes support for control structures like `while`, `if-else`, and `for` loops.

---

Installation
------------

[](#installation)

**Via Composer**

```
composer require isaeken/brick-engine
```

Quick Start
-----------

[](#quick-start)

The example below demonstrates a simple script that applies a discount if the cart total exceeds 100 units and then processes an e-commerce scenario by fetching a response from an external API.

```
