Use a chicagoboss built in filter in the code (outside of a template)

47 views Asked by At

I was using filter add to create dynamic tab indexes

{{tabindex_offset|add:1}}

But seems to be it's throwing error for an undefined tabindex_offset. So wanted to add custom filter like this:

add_by_custom(undefined, Count) ->Count;
add_by_custom(TabindexOffset, Count) ->
       chicagoboss_built_in_filter_module:add(TabindexOffset, Count).

Is there any way to call that built in filter in the code?

0

There are 0 answers