JMVC 3.2.4 here,
I've recently started using the model getters to represent attributes that are not provided on instantiation and are effectively helper methods. Here's an example:
Model
- getVerified: function() {
- return someExpression ? true : false
- }
- <% if (model.attr('verified')) { %>Verified Only Content<% } %>
There is the argument that this could be made more comprehensible by treating the method as a helper and to call the helper method in the template instead of using the attr() proxy.
My feeling is that "verified" can be effectively treated as a model attribute, regardless of it actually directly mapping to a data property being fed into the model instance. By doing this I can increase the use of attr() across the codebase and reinforce it's use (as it is not exclusively used everywhere).
What do you think?