PHPackages                             wscore/html - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. wscore/html

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wscore/html
===========

Html tag generator classes.

1.1.0(7y ago)26812MITPHPPHP ^7.1

Since Aug 20Pushed 7y ago1 watchersCompare

[ Source](https://github.com/WScore/Html)[ Packagist](https://packagist.org/packages/wscore/html)[ RSS](/packages/wscore-html/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (1)Versions (6)Used By (2)

WScore.Html
===========

[](#wscorehtml)

Html tag generation class for PHP.

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

[](#installation)

```
$ composer require wscore/html

```

Sample Codes
------------

[](#sample-codes)

### Basic HTML

[](#basic-html)

use `WScore\Html\Html` class to create an HTML object, as;

```
use WScore\Html\Html;

$html = Html::create('tagName')
            ->set('attribute', 'value')
            ->setContents('content');
echo (string) $html;
```

should output HTML like,

```
content
```

You can `set`, `add`, `remove`, `reset`, attributes.

There are some magic methods as well.

```
$html = Html::a('sample link')       // magic method to create a new tag and contents
            ->href('check.php')    // magic method to set href attribute
            ->target('_blank');
```

### HTML Form

[](#html-form)

use `WScore\Html\Form` class to create a HTML form object, as;

```
echo Form::open('check.php');
echo Form::input('checkbox', 'keep', 'alive')->class('form-element');
echo Form::close();
```

should create something like:

```

```

### Some Complex Case

[](#some-complex-case)

To create a nested html code,

```
echo Html::create('ul')
            ->class('form-list')
            ->setContents(
                Form::input('text', 'name')->placeholder('name here...'),
                Form::input('radio', 'yes', 'here')
            );
```

should result in following html code.

```

```

### Choices (radio, checkbox, and select)

[](#choices-radio-checkbox-and-select)

User `Form::choices` method to generate choices, such as radio buttons, checkboxes, and drop down selects.

For radio buttons;

```
echo Form::choices('test', [
    'val1' => 'label1',
    'val2' => 'label2'],
    'val2);
```

for checkboxes;

```
echo Form::choices('test', [
    'val1' => 'label1',
    'val2' => 'label2'],
    'val2)
    ->multiple();
```

and for drop-down selects;

```
echo Form::choices('test', [
    'val1' => 'label1',
    'val2' => 'label2'],
    'val2)
    ->expand(false);
```

Demo
----

[](#demo)

To see `WScore.Html` working in the demo,

```
$ git clone https://github.com/asaokamei/WScore.Html
$ cd WScore.Html
$ composer install
$ cd demo
$ php -S 127.0.0.1:8000

```

and browse the last URL.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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 ~527 days

Total

5

Last Release

2591d ago

Major Versions

0.1.x-dev → v1.x-dev2019-03-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/8ed783829e6fa0bd4b0def8c04ccfdfb2fc99f9e61e4a9470acad9e5abc5fcac?d=identicon)[asaokamei](/maintainers/asaokamei)

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/wscore-html/health.svg)

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

###  Alternatives

[raulr/google-play-scraper

A PHP scraper to get app data from Google Play

12994.7k](/packages/raulr-google-play-scraper)[etechnika/idna-convert

Etechnika.eu idna-convert

15395.3k3](/packages/etechnika-idna-convert)[hguenot/yii2-gsftp

Ftp is a FTP extension for \[YII 2 Framework\](http://www.yiiframework.com).

11106.4k1](/packages/hguenot-yii2-gsftp)[silverware/calendar

SilverWare Calendar Module.

1644.3k1](/packages/silverware-calendar)[croxton/imgixer

Generate Imgix URLs.

1210.6k1](/packages/croxton-imgixer)

PHPackages © 2026

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