Download the PHP package mezon/html-template without Composer

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

HTML template class

Build Status codecov Scrutinizer Code Quality

This class provides routine for HTML pages generation. Works fast and quite simple in use.

It is a part of Mezon Framework and used in the Application class

Learn more

More information can be found here:

Twitter

dev.to

I'll be very glad if you'll press "STAR" button )

Installation

Just type

Usage

Paths to template files

First of all you need to create object.

This code assumes that you have all template resources in the directory ./main-template/.

But you can also specify a list of paths, and while template compilation they all will be scanned for template files.

No need to specify all paths in the constructor. You can do it later with methods:

But be carefull if you have static files with the same names on different paths. While compilation the file on the latest added path will be used. It was done so to create a sort of overriding mechanism for template resources.

Or you can completely reset all paths:

And view a list of paths:

Setup layout

You can have different layouts for your pages:

Layout will let you to define different templates for your different purposes.

You can create in your template as much layouts as you need. Just add files:

Setup blocks

After the layout was setup you can pass blocks to the template.

It will allow you to put different content in your layout.

For example:

That means that HtmlTemplate class will get the file %template-sources%/Res/Blocks/%block-name%.tpl and put instead the placeholder {%block-name%} within your layout.

But you can place the block in any placeholder you need:

If you have $var=foo then your placeholder must be {foo}

Setting vars

You can also pass almost any data to the template

Compile template

Just call

The method will return a compiled page wich you can send to user of your application.


All versions of html-template with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
mezon/template-engine Version 1.0.*
mezon/conf Version 1.2.*
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 mezon/html-template contains the following files

Loading the files please wait ....