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

ActiveLibrary

ride/lib-html
=============

HTML library of the Ride framework

1.2.0(1y ago)05.1k9MITPHP

Since May 18Pushed 1y ago7 watchersCompare

[ Source](https://github.com/all-ride/ride-lib-html)[ Packagist](https://packagist.org/packages/ride/lib-html)[ RSS](/packages/ride-lib-html/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (10)Used By (9)

Ride: HTML Library
==================

[](#ride-html-library)

HTML helper library of the PHP Ride framework.

What's In This Library
----------------------

[](#whats-in-this-library)

### Element

[](#element)

The *Element* interface is used to implement an HTML element. It offers helper methods to set the attributes and a method to generate the HTML.

Different implementations of this interface are provided.

#### Anchor

[](#anchor)

The *Anchor* class is a representation of an *a* element as used anywhere in the body of an HTML document.

#### Image

[](#image)

The *Image* class is a representation of an *img* element as used anywhere in the body of an HTML document.

#### Meta

[](#meta)

The *Meta* class is a representation of a *meta* element as used in the head of an HTML document.

#### Pagination

[](#pagination)

The *Pagination* class is a helper to generate a pagination block. It takes care of many pages by creating gaps between the first, the active and the last page like in the following example.

```
< 1 2 ... 45 __46__ 46 ... 88 89 >

```

#### Table

[](#table)

The \_Table class is a representation of a *table* element as used anywhere in the body of an HTML document. There are extended implementations available depending on the use case or data source.

#### Row

[](#row)

The *Row* class is a representation of a *tr* element as used in a table of an HTML document.

#### Cell

[](#cell)

The *Cell* class is a representation of a *td* element as used in a table row of an HTML document.

#### HeaderCell

[](#headercell)

The *HeaderCell* class is a representation of a *th* element as used in a table row of an HTML document.

#### ArrayTable

[](#arraytable)

While the regular *Table* class expects you to create *Row* instances and so on, the *ArrayTable* class works differently. It's starting point in a simple array of data. Each element in the array is a *Row*. By adding a table *Decorator*, you create a column and decide the contents of the cell in that row by formatting the data or a part there of.

#### FormTable

[](#formtable)

The *FormTable* class works further on the *ArrayTable*. It creates a form component from the table and adds possibilities to add pagination, search, order and actions out of the box. You can extend it even further.

#### ExportTable

[](#exporttable)

The *ExportTable* interface adds export functionality to the table which implements it. You can add separate decorators for the export. The export gets populated by passing a *ExportFormat* implementation to it.

The *FormTable* class implements this interface.

### HtmlParser

[](#htmlparser)

The *HtmlParser* class helps you to process a piece of HTML. You can use it to make all images and anchors absolute instead of relative.

Code Sample
-----------

[](#code-sample)

Check the following code sample to see some of the functionality of this library:

```
