Download the PHP package computator/php-template-library without Composer

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

Overview

This library is a templating engine for PHP that uses native PHP syntax to increase template flexibility and reduce processing overhead.

Part of https://github.com/computator/php-framework-utils.

Code Coverage is available here.

Usage

Installation

The library is available on Packagist via composer, and is installable as computator/php-template-library or included in computator/framework-utils.

Method Overview

The primary engine interfaces are defined in the UserApi namespace.

Templates

Templates are executed with access to the methods defined in UserApi/ResolvedTemplateClient.

Using Short Open Tags, Alternative Control Structure Syntax, and leaving out the final semicolon in closing tags is encouraged to make templates more readable.

Template Types

There are several included template types:

Examples

These examples demonstrate the primary concepts of the library with a main, parent, and child template. Note that the templates can be modified to avoid referencing literal .php filenames by using an alternative TemplateResolver.

Multiple Child Blocks

main.php
parent.php
child.php

Primary Child Content

main.php
parent.php
child.php

Rendering

Rendering is controlled by creating a new instance of a UserApi/RenderClient.

The resolution of non-root template names to templates can be controlled by specifying an optional TemplateResolver. The default implementation passes the template name directly to the configured template class.

Examples

Default Resolver

Specifying a Resolver


All versions of php-template-library with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
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 computator/php-template-library contains the following files

Loading the files please wait ...