PHPackages                             netzmacht/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. netzmacht/html

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

netzmacht/html
==============

Simple library for html rendering

3.0.0(3y ago)472.2k↓31%1[1 issues](https://github.com/netzmacht/html/issues)[1 PRs](https://github.com/netzmacht/html/pulls)12LGPL-3.0-or-laterPHPPHP ^8.1

Since Jun 20Pushed 2y ago2 watchersCompare

[ Source](https://github.com/netzmacht/html)[ Packagist](https://packagist.org/packages/netzmacht/html)[ GitHub Sponsors](https://github.com/dmolineus)[ RSS](/packages/netzmacht-html/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (3)Versions (15)Used By (12)

HTML helper library
===================

[](#html-helper-library)

[![Build Status](https://camo.githubusercontent.com/434a9cd1087de7125fdf4023b21655fb70c7372a33f92ee9ba57eb120bec5aa3/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f776f726b666c6f772f7374617475732f6e65747a6d616368742f68746d6c2f436f64652532305175616c697479253230446961676e6f73746963732f6d61737465723f7374796c653d666c61742d737175617265)](https://github.com/netzmacht/html/actions/workflows/diagnostics.yml)[![Version](https://camo.githubusercontent.com/f762409ce504e6ea3985f8972ef633c794fc9e899dedd5743a16c57bd088cbcd/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6e65747a6d616368742f68746d6c2e7376673f7374796c653d666c61742d737175617265)](http://packagist.org/packages/netzmacht/html)[![License](https://camo.githubusercontent.com/fe8647b317d7b09866c607729c1f5d9263bf1d52aa94f7022f841ff5a1a76179/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6e65747a6d616368742f68746d6c2e7376673f7374796c653d666c61742d737175617265)](http://packagist.org/packages/netzmacht/html)[![Downloads](https://camo.githubusercontent.com/e6aad3f41ee2c7995f84811aea63ddd6bde9e6b10a3f405b52a887b287468285/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6e65747a6d616368742f68746d6c2e7376673f7374796c653d666c61742d737175617265)](http://packagist.org/packages/netzmacht/html)

This library is a PHP helper library for creating HTML output.

Install
-------

[](#install)

This extension can be installed using Composer

`composer require netzmacht/html:^3.0`

Requirements
------------

[](#requirements)

PHP `^8.1`

Basic Usage
-----------

[](#basic-usage)

Define the attributes in the View:

### Attributes

[](#attributes)

```
$attributes = new Netzmacht\Html\Attributes();
$attributes
    ->setId('a_id')
    ->addClass('a_class')
    ->setAttribute('data-target', '#some');
```

This library uses the magic `__toString` to converts the helper objects to string. Outputting is really simple now:

```
>Label This is a paragraph.
```

Of course you can change the attributes before generating

```
