Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Processing a value through a global helper (middleware) #3

Open
moniuch opened this issue Jan 23, 2017 · 0 comments
Open

Processing a value through a global helper (middleware) #3

moniuch opened this issue Jan 23, 2017 · 0 comments

Comments

@moniuch
Copy link

moniuch commented Jan 23, 2017

In the examples a funciton that is run on a view (or model) is usually its method. Would it be possible to implement a syntax which would allow to let a model property through a global function - like a helper, say: a function to format amount as currency.

So that if we have a model:

{
  name: Lexus,
  price: 81999,
}

we would run the price through a helper named amountToCurrency(amount, format) using a syntax along {{ ^amountToCurrency(amount, '$0.00') }}.

Is that feasible?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant