happyninjas/lex — Issue #23: Using modifiers/filters?
Author: mileswebdesign
Created: 2011-12-19 12:22:11+00:00
State: open

Hi guys, I was wondering if the option of having modifiers / filters (or however you want to name them) for variables would be something that could be added to Lex? I'm thinking something along the lines of:

Example 1

Uppercase modifier:
{{ title | uppercase }}
{{# Parsed: LEX IS AWESOME! #}}

Example 2

Character limit modifier:
{{ title | character_limit limit="10" suffix="..." }}
{{# Parsed: Lex is awe... #}}

Example 3

Chained modifier (uppercase and character limit):
{{ title | uppercase | character_limit limit="10" suffix="..." }}
{{# Parsed: LEX IS AWE... #}}

Not sure about the syntax yet, but the main idea is to have some kind modifiers similar to Smarty. Or are there other / better ways to get this functionality?

Would be happy to contribute to this feature, but will need some pointers to get started.