Download the PHP package dana/interpolator without Composer

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

Dana\Interpolator

Interpolator is a very simple string-interpolation library for PHP. It uses a syntax which combines features of Ruby, Jinja/Twig, and bash — including Jinja/Twig-style 'filters'.

Usage

Interpolator's render() method is its most useful — it performs the actual interpolation and then returns the result. render() takes two arguments: the string to be interpolated, and an array of 'fixtures' (values which might be injected into the string). When a place-holder (%{foo}) is encountered, that place-holder name (foo) will be looked up in the keys of the fixtures array, and the associated value will be inserted into the string where the place-holder used to be.

Filters

Each place-holder may optionally be suffixed by a pipe (|) and one or more single-character filter specifiers. Most of the available filters are used for escaping and hashing — for example, the e filter specifier passes the fixture value through escapeshellarg() before rendering it, and the m specifier hashes the value with MD5. There are also filters for case conversion (l, u), white-space manipulation (t, w, W), &c. Filters may be chained together — for example, lhj will convert the value to lower-case, then pass it through htmlspecialchars(), then pass it through json_encode() (in that exact order).

This is a list of the default filter specifiers and their behaviours:

You don't have to use the defaults though — you can override some or all of them using the setFilter() and setFilters() methods:

Interpolator also supports auto filters — filters which are applied automatically after all other filter processing has completed. This is particularly useful for creating HTML templates, for example. Auto filters can be surpressed using the special - filter specifier.

Misc.

By default, when Interpolator encounters a missing fixture or a fixture that can't be converted to a string, it throws an exception. You can disable this 'strict' behaviour by passing an option to the constructor:

Note that the presence of an illegal filter specifier will continue to raise an exception even when strict mode is disabled.

To do

Licence

MIT.


All versions of interpolator with dependencies

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

Loading the files please wait ....