Download the PHP package keepsuit/liquid without Composer

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

PHP implementation of Liquid markup language

Latest Version on Packagist Tests Total Downloads

This is a PHP porting of the Shopify Liquid template engine.

If you are using laravel, you can use the laravel-liquid package.

Liquid is a template engine with interesting advantages:

Shopify Liquid version compatibility

PHP Liquid Shopify Liquid
v0.8 v5.7
v0.7 v5.6
v0.1 - v0.6 v5.5

Differences from Shopify Liquid

Installation

You can install the package via composer:

Usage

Create a new environment factory instance:

Then create a new template instance parsing a liquid template:

And finally render the template:

For advanced use cases, you can also stream the rendering output (still experimental):

Drops

Liquid support almost any kind of object but in order to have a better control over the accessible data in the templates, you can pass your data as Drop objects and have a better control over the accessible data. Drops are standard php objects that extend the Keepsuit\Liquid\Drop class. Public properties and public methods of the class will be accessible in the template as a property. You can also override the liquidMethodMissing method to handle undefined properties.

Liquid provides some attributes to control the behavior of the drops:

If you implement the MapsToLiquid interface in your domain classes, the liquid renderer will automatically convert your objects to drops.

Advanced usage

Custom tags

To create a custom tag, you need to create a class that extends the Keepsuit\Liquid\Tag abstract class (or Keepsuit\Liquid\TagBlock if tag has a body).

[!NOTE] Take a look at the implementation of default tags to see how to implement parse and render methods.

Then you need to register the tag in the environment:

Custom filters

To create a custom filter, you need to create a class that extends the Keepsuit\Liquid\Filters\FiltersProvider abstract class.

Each public method of the class will be registered as a filter. You can "hide" a public method with the Hidden attribute, so it will not be registered as filter.

Then you need to register the filters provider in the environment:

Extensions

Extensions allow you to add custom tags, filters, and other features to the liquid environment.

To create a custom extension, you need to create a class that extends the Keepsuit\Liquid\Extensions\Extension abstract class.

Then you need to register the extension in the environment:

Custom tags and filters

By default, only the standard liquid tags and filters are available. But this package provides some custom tags and filters that you can use.

Tags

Filters

Testing

Changelog

Please see CHANGELOG for more information on what has changed recently.

Credits

License

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


All versions of liquid with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
ext-mbstring Version *
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 keepsuit/liquid contains the following files

Loading the files please wait ....