PHPackages                             sqrt-pro/tag - 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. [Framework](/categories/framework)
4. /
5. sqrt-pro/tag

ActiveLibrary[Framework](/categories/framework)

sqrt-pro/tag
============

Tag is part of SQRT Framework

01.5k2PHP

Since Apr 7Pushed 11y ago2 watchersCompare

[ Source](https://github.com/sqrt-pro/Tag)[ Packagist](https://packagist.org/packages/sqrt-pro/tag)[ RSS](/packages/sqrt-pro-tag/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (2)

Tag
===

[](#tag)

[![Build Status](https://camo.githubusercontent.com/e827cd40b9816e0e33ce8d83a2c1cc6c81973c5ecc5592ccb4f4bcd4053b9f16/68747470733a2f2f7472617669732d63692e6f72672f737172742d70726f2f5461672e7376673f6272616e63683d762e302e312e30)](https://travis-ci.org/sqrt-pro/Tag)[![Coverage Status](https://camo.githubusercontent.com/d18d521eb57d242a9352ace7137a4435ae4ea86bf0cde50ec39d4fbf142122c0/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f737172742d70726f2f5461672f62616467652e737667)](https://coveralls.io/r/sqrt-pro/Tag)[![Latest Stable Version](https://camo.githubusercontent.com/97b26c298b5204c47f5bbf197d41b28b270ea0b09f2dd3111e702d937ba83c64/68747470733a2f2f706f7365722e707567782e6f72672f737172742d70726f2f7461672f76657273696f6e2e737667)](https://packagist.org/packages/sqrt-pro/tag)[![License](https://camo.githubusercontent.com/bdf01a6cbab0c28ef22272fd76125512b5270551173ee8082226644b93cf6d37/68747470733a2f2f706f7365722e707567782e6f72672f737172742d70726f2f7461672f6c6963656e73652e737667)](https://packagist.org/packages/sqrt-pro/tag)

Класс `Tag` позволяет генерировать HTML-теги и задавать атрибуты к ним. Кроме непосредственно класса `Tag` имеется набор классов-наследников, для быстрого создания основных часто используемых тегов ``, ``, ``, ``, ``, ``.

```
use SQRT\Tag;

echo new Tag\A('#', 'hello');
// hello

echo new Tag\A('/one/', 'Hello', 'two', '_blank');
// Hello

echo new Tag('b', 'hello', array('style' => array('width' => '15px;', 'height' => '200px')));
// hello

echo new Tag\Input('two', 123, 'one', 'email');
//

$t = new Tag('input', '123', array('type' => 'text'), true);
$t->setId('one');
$t->setClass('two');
$t->setName('one[two]');
$t->setStyle('width: 100px;');
echo $t->toHTML();
//
```

Для генерации списков опций `input[type=checkbox]` и `input[type=radio]` предусмотрены классы `CheckboxListing` и `RadioListing`.

```
$t = new Tag\CheckboxListing('age', array(10 => '10 лет', 20 => '20 лет', 30 => '30 лет'));
$t->setSelected(array(10, 20));

//  10 лет
//  20 лет
//  30 лет
```

Полный набор примеров находится в тестах.

Объединение атрибутов
---------------------

[](#объединение-атрибутов)

Предусмотрен метод `Tag::MergeAttr($attr, $_ = null)`, позволяющий объединять несколько групп атрибутов в одну. Массивы объединяются по ключам, значения разделяются пробелами.

```
Tag::MergeAttr('one', array('id' => 'two')); // array('class' => 'one', 'id' => 'two');

Tag::MergeAttr('one', 'two'); // array('class' => 'one two');

Tag::MergeAttr(array('style' => 'border: red;'), array('class' => 'red', 'style' => 'color: green;'));
// array('style' => 'border: red; color: green;', 'class' => 'red');
```

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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://avatars.githubusercontent.com/u/8718914?v=4)[Квадратный Корень](/maintainers/sqrt-pro)[@sqrt-pro](https://github.com/sqrt-pro)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/sqrt-pro-tag/health.svg)

```
[![Health](https://phpackages.com/badges/sqrt-pro-tag/health.svg)](https://phpackages.com/packages/sqrt-pro-tag)
```

###  Alternatives

[laravel/dusk

Laravel Dusk provides simple end-to-end testing and browser automation.

1.9k39.6M298](/packages/laravel-dusk)[nineinchnick/edatatables

Grid widget for the Yii Framework, wrapper for the DataTables jQuery plugin

173.2k](/packages/nineinchnick-edatatables)[link-cloud/fast-hyperf

LinkCloud Fast Hyperf

241.2k1](/packages/link-cloud-fast-hyperf)

PHPackages © 2026

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