karimennassiri / Craft-TwigPCRE

Twig PCRE Filters for Craft CMS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Craft-TwigPCRE

Twig PCRE Filters for Craft CMS

##Filters:

See also: PHP PCRE-Functions

##Examples:

Basics:

|preg_filter(pattern, replacement, limit)

|preg_grep(pattern)

|preg_match(pattern)

|preg_quote(delimiter)

|preg_replace(pattern, replacement, limit)

|preg_split(pattern)

Please read the php docs for a more detailed explanation of all functions.

Usage:

{{ "This is a simple example."|preg_replace('/simple/', 'beautiful') }}

will output: This is a beautiful example.

##Install:

  1. Move the twigpcre directory into the craft/plugins/ directory.
  2. Go to Settings -> Plugins and enable 'Twig PCRE Filters'.

About

Twig PCRE Filters for Craft CMS

License:MIT License


Languages

Language:PHP 100.0%