harrydeluxe / php-liquid

A PHP port of Ruby's Liquid Templates
http://www.delacap.com/artikel/Liquid-Templates/
MIT License
239 stars 119 forks source link

Added increment and decrement tags #8

Closed v1o closed 12 years ago

v1o commented 12 years ago

Hello!

I've just added two new tags: increment and decrement. Their names are quite explanatory, the tags will increment and decrement a given value. For example:

{% assign val = "2" %}{% increment val %}{{ val }}

will render to 3, and

{% assign val = "2" %}{% decrement val %}{{ val }}

will render to 1.

I've also refactored the tests making them more readable by adding a small helper function.