/me was just wondering about so many occurrences of comma_format() and relativeTime() inside the template files..
Honestly, it's somewhat a string manipulation (preparing $context)) and should be part of the controller, not the template, right?
https://github.com/elkarte/Elkarte/wiki/Architecture
If we strictly follow this route we would need to get rid of $context in subs files (hard work, I know) and move function calls from the template to the controller (such as comma_format() and relativeTime(), maybe more)
No... I think it's more the other way around...
Controller sends data. Template receives it, and will display it
in any way it wants. Further string manipulation of the raw data is more the job of the template, or template helper functions [which do no exist, but perhaps should?].
If I want to use standardTime in the custom template, shouldn't I receive time, and change the call to relativeTime() to standardTime() at my ease?
I see, makes sense :) The controller would just send the plain timestamp and the template would render it to whatever ..
/me writes a template where all the times and dates are rendered as timestamps! :D
01010100 01000101 00100000 01101001 01110011 00100000 01100011 01110101 01110010 01110010 01100101 01101110 01110100 01101100 01111001 00100000 01110100 01110010 01100001 01101110 01110011 01101100 01100001 01110100 01101001 01101110 01100111 00100000 01100001 01101100 01101100 00100000 00100100 01110100 01111000 01110100 00100000 01110110 01100001 01110010 01110011 00100000 01101001 01101110 01110100 01101111 00100000 01100010 01101001 01101110 01100001 01110010 01111001 00100000 00111011 00101001
LOL
I think they should be moved to Template.subs or similar to show that they are template helpers.