-
Notifications
You must be signed in to change notification settings - Fork 64
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
Layout and helpers? #76
Comments
Isnt that possible using callables/closures? |
@holisticnetworking how would you imagine that working? |
One way might be to specify a "formatter" callable for each field. Thus $_extract might look like such:
|
Is this something you would be interested in building? I'm not sure how the user interface would be, and as the current formatting methods work fine for me, I'm not really inclined to write it. We can help you with tests once the pr is up. |
Let me look into the code a bit before I say something silly... |
I'm looking at the code, and while there is a variable created called "formatter," really, that's just an extraction function. It does not actually format anything in the sense of NumberHelper or similar functions. I'm going to play around with this some and see what I can do. |
Something like this could indeed work: $_formatters = [
'price' => ['NumberHelper::currency' [, 'col', 'col']],
'some_field' => function ($value) { //format }
....
] And then apply those callable if available prior to finally formatting the output? |
You are use callables in |
It would be especially nice to be able to use this plugin with some of my formatting helpers at my disposal.
The text was updated successfully, but these errors were encountered: