Download the PHP package wpscholar/templatex without Composer

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

TemplateX

A simple, micro template engine for PHP

Getting Started

Loading your template:

The template file:

Documentation

Is

Check if a variable has a specific value.

Params:

  • string - Name of the variable to check.
  • mixed - Value to check.

Return Value:

boolean

Description:

The is() method allows you to check if a variable in the template's context contains a specific value.

Has

Check if a variable exists.

Params:

  • string|array - Name of the variable to check, or a path to a nested value.

Return Value:

boolean

Description:

The has() method allows you to check if a variable exists in the template's context. You can pass in a variable name, or a path to a nested data structure. For example, you can pass in an array, or use dot notation (e.g. var.0.title will look for a variable named var, find the first item in the array, and then find the title property from the object).

Has In

Check if a value exists in an object or an array.

Params:

  • object|array - Data from which to locate value.
  • string|array - Name of variable, or nested path.

Return Value:

boolean

Description:

The hasIn() method is the same as the has() method, except you can pass in your own data as opposed to defaulting to the template's context.

Get

Get a variable.

Params:

  • string|array - Name (or path) of the variable to be fetched.
  • string|array - The default value to be returned if variable doesn't exist.

Return Value:

mixed

Description:

The get() method allows you to fetch a value from the template's context. You can pass in a variable name, or a path to a nested data structure. For example, you can pass in an array, or use dot notation (e.g. var.0.title to get the title property from the first value in the array contained in the variable named var.) Optionally, you can pass in a default value to be returned if the variable you are asking for isn't defined.

Get In

Get a value from an object or an array.

Params:

  • object|array - Data from which to fetch value.
  • string|array - Name (or path) of the variable to be fetched.
  • mixed - The default value to be returned if variable doesn't exist.

Return Value:

mixed

Description:

The getIn() method is the same as the get() method, except you can pass in your own data as opposed to defaulting to the template's context.

Set

Set a variable.

Params:

  • string|array - Name (or path) of the variable to be set.
  • mixed - The value to be assigned.

Return Value:

void

Description:

The set() method allows you to set a value in the template's context. You can pass in a variable name, or a path to a nested data structure. For example, you can pass in an array, or use dot notation (e.g. var.0.title to set the title property from the first value in the array contained in the variable named var.) Optionally, you can pass in a default value to be returned if the variable you are asking for isn't defined.

Set In

Set a value in an object or an array.

Params:

  • object|array - Data in which to set value.
  • string|array - Name (or path) of the variable to be set.
  • mixed - The value to be assigned.

Return Value:

mixed - Returns the updated data or original data on failure.

Description:

The setIn() method is the same as the set() method, except you can pass in your own data as opposed to defaulting to the template's context.

Delete

Unset a variable.

Params:

  • string|array - Name of the variable to be deleted.

Return Value:

void

Description:

The delete() method will remove a variable from the template's context.

Load

Loads a template from within an existing template.

Params:

  • string - Relative path to the template to be loaded.
  • array - An associative array containing variable names and values to pass to the template.
  • boolean - Whether or not to keep the variables from the parent template's context.

Return Value:

void

Description:

The load() method will output a child template within a template.

Render

Render a template to a string.

Params:

none

Return Value:

string

Description:

The render() method will return a string containing the rendered template.

Set Template

Set the template to be rendered.

Params:

string - Relative path to the template to be rendered.

Return Value:

void

Description:

The setTemplate() method is how you set the template that you want to render. It will be the relative path to the template (e.g. event.php).

Set Context

Set the context.

Params:

array - An associative array containing variable names and values to pass to the template.

Return Value:

void

Description:

The setContext() method allows you to pass variables to the template's context. Any variables passed will be made available to the template being rendered.

Set Template Paths

Set the template paths.

Params:

array - An array of template paths.

Return Value:

void

Description:

The setTemplatePaths() method allows you to define one or more template paths to check when attempting to load a template.

Add Template Path

Add a template path.

Params:

string - A template path to append to the list of template paths.

Return Value:

void

Description:

The addTemplatePath() method allows you to append a template path to the list of template paths to check when attempting to load a template.


All versions of templatex with dependencies

PHP Build Version
Package Version
No informations.
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 wpscholar/templatex contains the following files

Loading the files please wait ....