diff --git a/CHANGELOG.md b/CHANGELOG.md index 071f118..7cf6b14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Twig Perversion Changelog +## 2.0.4 - 2018.07.16 +### Added +* Added `string`, `float`, `int`, and `bool` typecast filters. + ## 2.0.3 - 2018.02.02 ### Removed * Pull support for `get_class` quick before anyone uses it (use Craft's native `className` instead) diff --git a/README.md b/README.md index 414e3d5..c003afd 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,10 @@ Making twig do things it really shouldn't. Twig is not intended to be a gene - `is numeric` test - `json_decode` filter - `array_splice` filter -- `string` and `s` filters -- `float` and `f` filters -- `int` and `i` filters -- `bool` and `b` filters +- `string` filter +- `float` filter +- `int` filter +- `bool` filter ## Installation @@ -86,19 +86,19 @@ A macro with a `{% return %}` tag will return whatever the return value is (whic Remove a portion of an array and replace it with something else. Uses the PHP [array_splice](http://php.net/manual/en/function.array-splice.php) function. Note that unlike the php function, this filter returns the modified array rather than the extracted elements. The original array is unchanged. Since the implementation requires copying the array, this will be less efficient than the raw php function. The **array_splice** filter is passed an `offset`, an optional `length`, and an optional `replacement`. -- **string** or **s** +- **string** Typecast variable as a string. -- **float** or **f** +- **float** Typecast variable as a float. -- **int** or **i** +- **int** Typecast variable as an integer. -- **bool** or **b** +- **bool** Typecast variable as a boolean. diff --git a/composer.json b/composer.json index ee8ea78..3a4fee4 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "marionnewlevant/twig-perversion", "description": "Making twig do things it really shouldn't", - "version": "2.0.3", + "version": "2.0.4", "type": "craft-plugin", "keywords": [ "craft", "craftcms", "plugin", "twigperversion" diff --git a/src/twigextensions/TwigPerversionTwigExtension.php b/src/twigextensions/TwigPerversionTwigExtension.php index 497622b..ea591e9 100644 --- a/src/twigextensions/TwigPerversionTwigExtension.php +++ b/src/twigextensions/TwigPerversionTwigExtension.php @@ -75,10 +75,6 @@ public function getFilters() new \Twig_SimpleFilter('float', [$this, 'float']), new \Twig_SimpleFilter('int', [$this, 'int']), new \Twig_SimpleFilter('bool', [$this, 'bool']), - new \Twig_SimpleFilter('s', [$this, 'string']), - new \Twig_SimpleFilter('f', [$this, 'float']), - new \Twig_SimpleFilter('i', [$this, 'int']), - new \Twig_SimpleFilter('b', [$this, 'bool']), ]; }