PHPackages                             cliqon/clqrazr - 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. cliqon/clqrazr

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

cliqon/clqrazr
==============

Razr - The powerful PHP template engine

048PHP

Since May 3Pushed 3y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (1)Used By (0)

clqrazr
=======

[](#clqrazr)

Copy of Everest-Php Razr with Cliqon changes for PHP 8.1

Razr - The powerful PHP template engine
=======================================

[](#razr---the-powerful-php-template-engine)

Razr is a powerful PHP template engine for PHP, whose syntax was inspired by ASP.NET Razor.

Usage
-----

[](#usage)

Render a template:

```
$razr = new Razr\Engine(new Razr\Loader\StringLoader);
echo $razr->render('Hello @( $name )!', array('name' => 'World'));
```

Render a template file with caching:

```
$razr = new Razr\Engine(new Razr\Loader\FilesystemLoader(__DIR__), '/path/to/cache');
echo $razr->render('hello.razr.php', array('name' => 'World'));
```

Syntax
------

[](#syntax)

The Razr syntax uses `@` as special character. It is used to indicate a dynamic statement for the template engine. Within the `@()` notation you may use regular PHP. The following statements are supported.

### Echo data

[](#echo-data)

Use the `@()` notation to echo any PHP data with escaping enabled by default.

**Example**

```
@( $title )
@( 23 * 42 )
@( " is escaped by default." )
```

**Output**

```
Some title
966
&lt;Data&gt; is escaped by default.
```

### Echo raw data

[](#echo-raw-data)

Use the `@raw()` directive to output any PHP data without escaping.

**Example**

```
@raw("This will not be escaped.")
```

**Output**

```
This will not be escaped.
```

### Variables

[](#variables)

You can access single variables and nested variables in arrays/objects using the following dot `.` notation.

```
array(
    'title' => 'I am the walrus',
    'artist' => array(
        'name' => 'The Beatles',
        'homepage' => 'http://www.thebeatles.com',
    )
)
```

**Example**

```
@( $title )
by @( $artist.name ), @( $artist.homepage )
```

**Output**

```
I am the walrus
by The Beatles, http://www.thebeatles.com
```

### Set variable values

[](#set-variable-values)

**Example**

```
@set($msg = "Hello World!")
@( $msg )
```

**Output**

```
Hello World!
```

### Conditional control structures

[](#conditional-control-structures)

Use `@if`, `@elseif`, `@else` for conditional control structures. Use any boolean PHP expression.

**Example**

```
@set($expression = false)
@if( $expression )
    One.
@elseif ( !$expression )
    Two.
@else
    Three.
@endif
```

**Output**

```
Two.
```

### Loops

[](#loops)

You can use loop statements like `foreach` and `while`.

```
@foreach($values as $key => $value)
    @( $key ) - @( $value )
@endforeach

@foreach([1,2,3] as $number)
    @( $number )
@endforeach

@while(true)
    Infinite loop.
@endwhile
```

### Include

[](#include)

Extract reusable pieces of markup to an external file using partials and the `@include` directive. You can pass an array of arguments as a second parameter.

**Example**

```
@include('partial.razr', ['param' => 'parameter'])
```

`partial.razr`:

```
Partial with @( $param )
```

**Output**

```
Partial with parameter
```

### Extending templates with blocks

[](#extending-templates-with-blocks)

Use the `@block` directive to define blocks inside a template. Other template files can extend those files and define their own content for the defined blocks without changing the rest of the markup.

**Example**

```
@include('child.razr', ['param' => 'parameter'])
```

`parent.razr`:

```
Parent template

@block('contentblock')
    Parent content.
@endblock

Parent content outside of the block.
```

`child.razr`:

```
@extend('parent.razr')

@block('contentblock')
    You can extend themes and overwrite content inside blocks. Paremeters are available as well: @( $param ).
@endblock
```

**Output**

```
Parent template

You can extend themes and overwrite content inside blocks. Paremeters are available as well: parameter.

Parent content outside of the block.
```

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity22

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/86673de89f12488ec57e10f9b520382a6c8fcd0c17993abcb9e66b546b1d6870?d=identicon)[webcliq](/maintainers/webcliq)

---

Top Contributors

[![webcliq](https://avatars.githubusercontent.com/u/1401189?v=4)](https://github.com/webcliq "webcliq (4 commits)")

### Embed Badge

![Health badge](/badges/cliqon-clqrazr/health.svg)

```
[![Health](https://phpackages.com/badges/cliqon-clqrazr/health.svg)](https://phpackages.com/packages/cliqon-clqrazr)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

545.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
