Does anyone know how to assign and then use closure in a model / view using F3 :: set? Or suggest a solution for the following scenario?
I am using version 1.4.4
Here is what I am trying to do:
//In Model - Loaded from controller w/ F3::call
F3::set('getPrice', function($tax, $profile){
//return price
});
//In View - Inside an F3:repeat of @products
{@getPrice(@product.tax, @product.profile)}
But closing is not supported. If I load the model using require / include, define a function w / o F3 :: set and enable user-defined functions in the view, I can make it work. But I was hoping to maintain the separation level provided with F3 :: call / F3 :: set.
Thank!
source
share