Download the PHP package aleksip/plugin-data-transform without Composer

On this page you can find all versions of the php package aleksip/plugin-data-transform. 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 plugin-data-transform

Data Transform Plugin for Pattern Lab

Installation

To install and use the plugin run the following command in the Pattern Lab root directory:

Configuration options

For Attribute object support to work properly, your Pattern Lab config.yml file needs to have the following setting:

The default values for Data Transform Plugin specific options in config.yml are:

Enabling and disabling the plugin

Once installed, it is possible to enable and disable Data Transform Plugin using the enabled setting.

Verbose mode

Occasionally it might happen that there is a problem with a data file, and PHP notices and/or warnings with long stack traces are displayed when Pattern Lab is generated. In a large project it can be difficult to find the problematic data file, but turning on Data Transform Plugin's verbose mode using the verbose setting can help.

In verbose mode Data Transform plugin reports each pattern it processes and all data transform functions performed. It also suppresses regular PHP error messages and reports about errors in an easier to read way.

Important note: due to the way verbose mode is implemented, it might not work if other plugins that interact with the Twig Environment object are used.

Features

Pattern-specific data file support for included patterns

Pattern Lab core only supports global data files and a pattern-specific data file for the main pattern. This plugin adds pattern-specific data file support for included patterns. This feature works with the include function provided by this plugin with all PatternEngines and also with regular includes in template files with Twig PatternEngine.

Please note that global data from the _data directory is considered to be pattern-specific data and will overwrite data inherited from a parent pattern. If you want to override data of an included pattern you can use the with keyword.

Data transform functions

Currently the plugin provides four transform functions for the data read by Pattern Lab. The examples provided are in JSON but Pattern Lab supports YAML too.

Include pattern files

If a value contains the name of a pattern in shorthand partials syntax, the plugin will replace the value with the rendered pattern:

Advanced syntax with support for passing variables (with) and disabling access to the default data (only):

In both examples the value of key will replaced with the rendered pattern.

For more information about with and only please refer to the Twig include documentation.

Include pseudo-pattern files

It is also possible to include pseudo-patterns using the shorthand partials syntax, by replacing the tilde (~) with a dash (-). So for example the pseudo-pattern shila-card.html~variant.json can be included like so:

Join text values

The value of key will be replaced with the joined strings. Note that in the example molecules-comment-html is the name of a pattern in shorthand partials syntax. These will be replaced with the rendered pattern before the join.

Create Drupal Attribute objects

The value of key will be replaced with an Attribute object.

Create Drupal Url objects

The value of key will be replaced with an Url object. Note that in the example the value of attributes will be replaced with an Attribute object before the Url object is created.


All versions of plugin-data-transform with dependencies

PHP Build Version
Package Version
Requires php Version >=5.5.9
pattern-lab/core Version ^2.6.3
drupal/core-render Version ^8.7
drupal/core-utility Version ^8.7
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 aleksip/plugin-data-transform contains the following files

Loading the files please wait ....