PHPackages                             brianlaclair/eq - 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. brianlaclair/eq

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

brianlaclair/eq
===============

Buffered function-based HTML generator for PHP

v1.0.0-alpha2(4y ago)0121MITPHPPHP &gt;=7.3

Since Jan 13Pushed 4y ago2 watchersCompare

[ Source](https://github.com/brianlaclair/eq.php)[ Packagist](https://packagist.org/packages/brianlaclair/eq)[ Docs](https://brianlaclair.com/)[ RSS](/packages/brianlaclair-eq/feed)WikiDiscussions main Synced 1mo ago

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

eq.php 🎯
========

[](#eqphp-)

eq is a function library developed to make outputting HTML a breeze in PHP

the basics
----------

[](#the-basics)

eq has buffered output, meaning that it doesn't actually dump what you've created until you tell it to.

All eq documents start with `eq_start();` and end with `eq_end();`

With eq, we can generate HTML that looks like this ⏬

```

eq.php

```

from a script that looks like this ⏬

```
eq_start("eq_title=eq.php",["description", "example eq page"], "style.css", "prism.css", "https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js");
eq_end();

```

We can add HTML elements after we've called `eq_start()` by using a plethora of functions

head content
------------

[](#head-content)

Head information can be added inside of `eq_start()`, or separately from individual function calls as-needed.

### `eq_start()`

[](#eq_start)

accepts a range of arguments - as seen in the example above, **linked items (CSS files, JS files)** will automatically import to the head section if listed in the arguments of this function.

**meta tags** can be included in an `eq_start` call by listing them as an array, ie, `eq_start(["description", "example eq page"])` would give you ` `(it's worth noting that cases are registered not only for standard pattern-breaking meta tags, i.e. `["UTF-8"]` as ``, but also for non-standard meta tags such as `og:`, `fb:`, and `article:` that return `property` rather than `name`)

Some items need to be better defined - specifically **styles and scripts that are not linked** (eg, `eq_start("eq_style=.cssclass { background-color: #000; }")` or `eq_start("eq_script=alert('Hello World!');")`) the **title** of the page can be defined in `eq_start()` by using `"eq_title=This Is A Website!"`

With **all** of the aforementioned cases, you can instead use one of the functions below and omit it from your `eq_start` arguments.

### Reference

[](#reference)

functionusageeq\_startcovered in detail above, accepts an infinite number of argumentseq\_title`eq_title(string)` can be used anywhere within an eq document to set the title of the page. It can only be called once on a document, whether it be with `"eq_title=This Page"` in `eq_start` or standalone below it.eq\_meta`eq_meta(string, [string])` automatically generates a meta tag in the head#### context-based head functions

[](#context-based-head-functions)

these functions will act differently depending on if you've already added body content or not

functionusageeq\_style`eq_style(string, [head])` can accept either a URL to link, or CSS to output within tags. You can add an optional boolean argument to define if it's in the head or not (defaults based on context)eq\_script`eq_script(string, [head])`can accept either a URL to link, or script to output within tags. You can add an optional boolean argument to define if it's in the head or not (defaults based on context)body content
------------

[](#body-content)

### Reference

[](#reference-1)

functionusageeq\_div`eq_div([class], [id], [attributes])` inserts a `` tag with optional classes, id, and extra attributes (styles can be accepted, etc)eq\_div\_end`eq_div_end([ittr])` inserts a `` tag with optional repetitions. Alternatively, passing a string rather than a number of iterations (or nothing) will result in opening and closing an empty div, such as `eq_div_end('class="test"');` would result in ``eq\_text`eq_text(string, [type], [class], [return])` output text matching the first argument. The \[type\] argument allows you to encompass the text in an element, for example `eq_text("Hello World", "h1");` outputs `Hello World`. The class argument allows you to define classes for the element, and setting \[return\] to true results in the output being returned rather than outputted to the buffereq\_link`eq_link(urlstring, [text], [class], [return])` creates a link to the first argument. \[text\] defines the display text (if not set, defaults to the URL string).

**note:** the return argument for `eq_link` is different than other functions - it is intended to be used in conjunction with `eq_text` such as: `eq_text("Hello world, check out this link: " . eq_link("https://google.com/"));`eq\_image`eq_image(urlstring, [class], [attr], [return])` inserts an image, with optional classes and HTML attributes (ie, `width=200px`)eq\_br`eq_br([ittr], [return])` insert \[ittr\] of line breaks, defaults to 1eq\_button`eq_button(string, [action], [class])`eq\_table`eq_table([class], [id])` opens a tableeq\_caption`eq_caption(string, [class])` add a caption to the tableeq\_table\_row`eq_table_row(cell, cell...)` inserts a new row into the open table, with an unlimited number of cell argumentseq\_table\_end`eq_table_end()` closes the table

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity31

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.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

1584d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/83cc0a28154efa1d17b324a1fab5d53dadd2cf9550be9af2d79d26abfda37e4d?d=identicon)[brianlaclair](/maintainers/brianlaclair)

---

Top Contributors

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

---

Tags

htmlmarkup

### Embed Badge

![Health badge](/badges/brianlaclair-eq/health.svg)

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

###  Alternatives

[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.5k34.7M186](/packages/phpoffice-phpword)[latte/latte

☕ Latte: the intuitive and fast template engine for those who want the most secure PHP sites. Introduces context-sensitive escaping.

1.3k15.7M683](/packages/latte-latte)[twig/string-extra

A Twig extension for Symfony String

21946.0M133](/packages/twig-string-extra)[exercise/htmlpurifier-bundle

HTMLPurifier integration for your Symfony project

27911.3M16](/packages/exercise-htmlpurifier-bundle)[twig/markdown-extra

A Twig extension for Markdown

12114.3M83](/packages/twig-markdown-extra)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7526.3M230](/packages/laminas-laminas-view)

PHPackages © 2026

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