Download the PHP package crell/htmlmodel without Composer
On this page you can find all versions of the php package crell/htmlmodel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download crell/htmlmodel
More information about crell/htmlmodel
Files in crell/htmlmodel
Package htmlmodel
Short Description Domain value objects for modeling HTML pages
License MIT
Homepage https://github.com/Crell/HtmlModel
Informations about the package htmlmodel
HtmlModel
HtmlModel is exactly what it sounds like. It is a series of value objects intended to model an HTML page. It does not attempt to model every element in HTML (that would be silly), but just the key aspects of it. In a sense, it seeks to provide an HTML equivalent of RESTful domain models such as HAL or Atom.
Inspired by PSR-7, all objects are immutable. They may be manipulated with with*() methods, which return new value object instances. Link handling uses the PSR-13 hyperlink specification.
This approach was inspired by, and evolved from, similar code that exited in Drupal 8 during development but was later removed.
Install
Via Composer
Usage
If you've used a PSR-7 Request or Response object, HtmlModel should be quite similar. Most of the time you'll be interacting with either an HtmlFragment or an HtmlPage.
The HtmlPage can even contain an HTTP status code. Although it won't get rendered it can be transferred to a Response object, allowing the page creator to specify the type of response through a straightforward domain object.
The cool part, though, is when you can aggregate multiple fragments into a page cleanly. That lets you build multiple portions of a page in parallel, even asynchronously, even caching some portions of the page but not others, and then fold them together into a single page.
Change log
Please see CHANGELOG for more information what has changed recently.
Testing
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email the author instead of using the issue tracker.
Credits
License
The LGPL License, version 3 or, at your option, any later version. Please see License File for more information.