Download the PHP package tpawl/lite without Composer

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

LiTE

Lightweight Template Engine

Build Status Coverage Status

Description

LiTE is an ad hoc Template Engine especially suited for Backends. It is native, because it uses PHP as its Template Language and needs no compiling of templates. It supports Template Variables and View Helpers.

Requirements

LiTE requires PHP 7.3+

Installation

Via Composer

Usage

LiTE for Developers

Basics

The heart of LiTE is a object called the template expression (of class TPawl\LiTE\Expressions\TemplateExpression).

A template expression object is created like this:

This will create a template expression that looks up the view helpers in the /path/to/view_helpers/ folder.

Note that the only argument of the template expression is an array of settings options.

Outputting the template

Defining a view helper

A view helper is a class that implements the interface TPawl\LiTE\ViewHelperInterface, that has a static execute method. The name of that class must be ending with ViewHelper and the first letter must be upper-case. The code for this class must be saved in a file with the name of the corresponding class with a trailing .php. This file must be stored in a folder given as the third configuration option of the template expression.

Example:

$arguments is an indexed array of arguments that can be given to the view helper. Output in the view helper can be done with echo, print, printf, ...

Sub template expression

Objects of the class TPawl\LiTE\Expressions\SubTemplateExpression are intended for use inside a view helper. The constructor takes two arguments:

Example:

Miscellaneous

To determine wether you are inside/outside of a view helper you can use the static method TPawl\LiTE\Context\Context::isEmpty(). It returns false if you are inside a view helper, true otherwise.

There is the class TPawl\LiTE\Version defined, that holds version information for LiTE. It has the following constants defined:

Examples:

LiTE for Template Designers

Template variables

This defines a template variable with name foo. The complete expression above is replaced by the value of the template variable foo.

View helpers

This calls the view helper BarViewHelper with no arguments. If you have arguments, you have to write them as a comma separated list between the parentheses after bar. Example: ``

The complete expression above is replaced by the output of the view helper BarViewHelper.

Predefined view helpers

There is the view helper _xmlViewHelper predefined. It is called like this:

This will convert to <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>. It is useful if you want to output XML.

Example

Save the following view helper to a file named MsgViewHelper.php in any folder:

Suppose you have the following script in the same folder as the above view helper:

If you call the above script in the browser, one possible output could be:


All versions of lite with dependencies

PHP Build Version
Package Version
Requires php Version >=7.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 tpawl/lite contains the following files

Loading the files please wait ....