PHPackages                             zv/zview - 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. zv/zview

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

zv/zview
========

a simple php template engine, support swoole/php-fpm, high performance, easy, flexible, single file.

v1.0.4(5y ago)260MITPHPPHP &gt;=5.6

Since Jul 17Pushed 5y agoCompare

[ Source](https://github.com/djunny/ZView)[ Packagist](https://packagist.org/packages/zv/zview)[ Docs](https://github.com/djunny/ZView)[ RSS](/packages/zv-zview/feed)WikiDiscussions master Synced 1w ago

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

ZView
=====

[](#zview)

a simple php template engine, support swoole/php-fpm, high performance, easy, flexible, single file.

### Installation

[](#installation)

```
composer require zv/zview

```

### BASE

[](#base)

1. 默认注释语法
2. {code} html嵌入属性语法
3. {$variable} 输出变量
4. {CONSTANT} 输出常量
5. {$array\['index'\]} 输出数组下标
6. {function(param1, param2, param3...)} 调用原生方法

模板中动态渲染内容，基本上由以上语法组成。

- 语法1 多用于 html 块级输出，例：

```

```

- 语法2 多用于元素属性输出，例：

```

```

- 语法6 调用原生方法，输出值必须为方法结果 return

### sub template

[](#sub-template)

说明：

加载一个子模板。(子模板最多支持三层嵌套)

语法：

```

```

### logic if/else

[](#logic-ifelse)

```

    a = b AND b = $b

    b = $b OR a = $a

    a = 1

    a != 1

```

### loop

[](#loop)

循环输出列表，可嵌套输出

```

        categories[$index][$sub_index]= {$cate['name']}

```

### eval

[](#eval)

```

```

### method/function call

[](#methodfunction-call)

调用的方法并输出返回的内容。(方法必须以返回值)

```
{date('Y-m-d')}
{substr('123', 1)}
{print_r(array(1), 1)}
{spider::html2txt('')}
{spider::GET('http://www.baidu.com/')}

```

### block 块声明与使用

[](#block-块声明与使用)

声明一个代码块。

```

        $value

{block_test(array(4,3,2,1))}

```

更多 Demo，请参考 example 中例子。

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

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.

###  Release Activity

Cadence

Every ~40 days

Total

5

Last Release

1971d ago

PHP version history (2 changes)v1.0.0PHP &gt;=5.3.0

v1.0.1PHP &gt;=5.6

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1797883?v=4)[djunny](/maintainers/djunny)[@djunny](https://github.com/djunny)

---

Tags

phpperformancephp-fpmswooleFlexibletemplate engineeasy

### Embed Badge

![Health badge](/badges/zv-zview/health.svg)

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

###  Alternatives

[talesoft/tale-pug

A clean, lightweight and easy-to-use templating engine for PHP based on Pug, formerly Jade

319.4k3](/packages/talesoft-tale-pug)

PHPackages © 2026

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