Download the PHP package lewiscom/twigextensions without Composer

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

TwigExtensions module for Craft CMS 3.x

This module adds some extra functionality to Twig.

Requirements

This module requires Craft CMS 3.0.0-RC1 or later.

Installation

Require the composer package

Add to the module to your config/app.php

Settings

If you need to disable certain extensions on a per environment basis, simply copy the configuration file below, name it 'twigextensions.php place it in your craft/config folder. Here it will follow the same environemnt rules as other craft configuration.

Extensions

CaseExtension

Adds various case converting helpers

Filter Input Output Description
camelCase {{ 'camel-case-this-string'\|camelCase }} camelCaseThisString Camel cases a string
StudlyCase {{ 'studly-case-this-string'\|studlyCase }} StudlyCaseThisString Studly, or Pascal, cases a string
kebab-case {{ 'studly-case-this-string'\|kebabCase }} kebab-case-this-string Kebab cases a string

DumpDieExtension

Makes the larapack/dd functions available in twig templates

Function Input Description
d {{ d(variable) }} Will dump the variable
dd {{ dd(variable) }} Will dump the variable and stop further execution

GlobalVariablesExtension

Twig 2.x changes the way variables are scoped, this extension can help bring back some globals that you might not want to import into every template. You may add as many global variables as you'd like, and set them to different values depending on environment

RelativeDateExtension

By default, it will convert a date object into a human readable relative date to the current date and time.

Filter Input Output Description
relativeDate {{ entry.createdAt|relativeDate }} 2 hours ago Outputs a human readable relative date to the current date and time
Parameter Description Default Required
to A date to compare the initial date to false
precision How precise the readout needs to be, increasing the number increases the precision 1
suffix The suffix, set false to disable 'ago'

Examples

RegExpExtension

Adds various regular expression functions

Function Input Output Description
pregReplace {{ pregReplace('test 123', '/\\D+/') }} 123 Uses PHPs preg_replace function to search and replace using regular expressions
Parameter Description Default Required
value The string that will be searches -
pattern The regular expression pattern to be used. Note you must escape backslashes -
replacement What matches will be replaced with ''
limit The maximum number of matches -1

Brought to you by Lewis Communications


All versions of twigextensions with dependencies

PHP Build Version
Package Version
Requires php Version >7.0
craftcms/cms Version ^3.0.0
larapack/dd Version ^1.1
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 lewiscom/twigextensions contains the following files

Loading the files please wait ....