Skip to content

Commit

Permalink
No single character typecast filters, and version bump
Browse files Browse the repository at this point in the history
  • Loading branch information
marionnewlevant committed Jul 16, 2018
1 parent 86abd57 commit 852bfb0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 0 additions & 4 deletions src/twigextensions/TwigPerversionTwigExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']),
];
}

Expand Down

0 comments on commit 852bfb0

Please sign in to comment.