Download the PHP package html5/fhtml without Composer

On this page you can find all versions of the php package html5/fhtml. 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 fhtml

FHtml - Fluent HTML

Fluent HTML Generator for PHP7 - Version 0.2 - 2016-08-23 - Written by Matthias Leuffen

Generating correct and secure HTML Code within your PHP-Code causes headache. Using FHtml's fluent speaking Api will save you lots of money you'd otherwise spent on aspirin.

It comes with an @-attribute-parser for easy and painless writing; you don't need any quotes (' or ") within your quoted strings.

Example? See the Kickstart:

Kickstart - See FHtml in action:

yes - no double quotes needed to generate valid and proper escaped xhtml:

Use the fluent-API to generate structures:

yeah: Your PHP-code is shorter than the raw html! And proper indention is done as well:

Have you ever written a <select>-box with preselected value? This is the FHtml-way:

Using an IDE (PhpStorm)? FHtml comes with full code-completion on all layers. Stop typing - just hit CTRL-SPACE and ENTER.

Features

Install

FHtml is available as composer-package at packagist.com:

or just add it to your composer.json:

Hint: Use composer upgrade --prefer-dist to omit unit-tests and development files

Error Reports

Please report errors, wishes and feedback:

Usage

@-attributes

FHtml parses a single string input on elem() Method (or any direct tag-method like div() or span()) and parses it.

To inject insecure or not properly escaped values from outside, use the ?-Placeholder construct:

DON'T DO THAT:

use the auto-escaping array construct with ? as placeholder and add the raw values as additional parameter(s):

Inserting a text-node

To insert plain text to an element use the text($text) - method. The text in Parameter 1 will be html-escaped.

Will generate:

End an element

You can use the end() Method to jump back to the parent element.

Jump Marks

You can use the as(<jumpMark>) Method to define a element you can jump to from anywhere by using goto(<jumpMark>):

The example will append the <p> element to the <body> element.

Generating <select> Options from arrays

Use the options(array $options, string $preselect) - method to create select-options with preselected Value on the fly:

Imagine you have some mapping of key-values array for your select-field:

Just set them as first parameter of options() and the submitted Value from Post into the second parameter:

will generate:

API Alternatives

These Samples are doing exact the same. Choose the api you like most:

I prefer using the shortest:

Related Projects

If you like FHtml you might be interested in some of my other projects:

Author

Written 2016 by Matthias Leuffen leuffen.de

License

MIT-License


All versions of fhtml with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
html5/template Version *
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 html5/fhtml contains the following files

Loading the files please wait ....