Download the PHP package myerscode/templex without Composer

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

Templex

A lightweight, regex based template rendering engine for PHP

Latest Stable Version Total Downloads License Tests

Why this package is helpful?

This package will allow you to define stubs and then hydrate the template using PHP variables. As the engine uses RegEx it does not rely on using eval or including and running the code as PHP.

This means that you are able to simply generate new PHP (or any type of text content filled files for that matter) you need.

Install

You can install this package via composer:

Usage

Template Directory

Templates

Templates can be any form of text based files. By default, Templex will look for files with .stub or .template file extensions.

Templex uses <{ and }> as opening and closing anchor tags to find and process Slots, which can be used to generate dynamic views from placeholders and logic.

Slots

Slots are the "magic" of Templex. They are the isolated functionality that perform replacement and hydrating actions on a template to create the final rendered output.

The default included slots are:

Includes

To include another template, in order to create reusable stubs you can simply include it by its template name.

Conditions

Templex can process nested slots, so having nested control conditions are handled in the order they are found.

Conditions can be variables, numbers, booleans or literal strings and can the usual comparison evaluators.

Examples

Loops

Loops will take an array variable to create multiple iterations in your template.

Examples

Variables

Variables are replaced matching anchors are found. They can are passed in at rendering, or created via other slots such as Loops.

Examples

Issues and Contributing

We are very happy to receive pull requests to add functionality or fixes.

Bug reports and feature requests can be submitted on the Github Issue Tracker.

Please read the Myerscode contributing guide for information on our Code of Conduct.

License

The MIT License (MIT). Please see License File for more information.


All versions of templex with dependencies

PHP Build Version
Package Version
Requires php Version ^8.0
myerscode/utilities-files Version ^1.0|^2.0
myerscode/utilities-strings Version ^1.0|^2.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 myerscode/templex contains the following files

Loading the files please wait ....