Download the PHP package mouf/html.tags without Composer

On this page you can find all versions of the php package mouf/html.tags. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package html.tags

What is this package?

This package contains a pure PHP object representation of HTML5 tags. There is one class for each existing HTML tag, and one getter/setter per attribute.

Why bother?

There are plenty of ways to represent HTML tags as PHP objects, and most of the time, you might not need one class per tag (you can use a generic PHP object representing any HTML tag like here, here or , here).

So why bother with one class per tag?

Well for a few reasons:

List of supported tags

Basically, all the tags supported and not deprecated in HTML5. You can get a complete list on the W3C wiki.

How to use it?

Basic usage

Pretty easy. You just create a tag using the new keyword and use getters and setters to set attributes. Finally, you call the toHtml() method to render the tag.

Fluent interface

The setter are using a fluent interface, so you can chain several setters if you want:

Setting classes and styles

You can set classes and styles using arrays or strings:

You can also add a class or a style using addClass or addStyle.

Managing children

You can add children to your tags using setChildren or addChild.

Adding text to a tag

Use the addText to add text to a tag.

Note: this is similar to creating a HtmlString instance and adding it to the node:

Adding your own custom tags

You might be interested in adding your owns classes that generate custom HTML code. All you have to know is that all the tags are implementing the HtmlElementInterface.

This is a simple interface with a single toHtml() method.

What is this ValueInterface thing?

If you have had a look at the code, you might have noticed that each setter accepts objects implementing the ValueInterface interface.

This is a very powerful feature allowing you to put objects that will be evaluated when they are rendered. When the tag is rendered, the val() method of the object is called and attributed.

Mouf package

This package is part of Mouf, an effort to ensure good developing practices by providing a graphical dependency injection framework.


All versions of html.tags with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.4
mouf/html.htmlelement Version ~2.0
mouf/utils.value.value-interface Version ~1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mouf/html.tags contains the following files

Loading the files please wait ....