I have an embedded template (called from another template passing it variables) which does some calculations based on a channel that holds the parameters of the calculations in it. So it’s a complex template with lots of code, including loops of Matrix fields, among other things.
The template is set to PHP on Output as little bits of PHP are doing the actual calculations inside of the loops. (I’m actually quite pleased with myself and my elegant solution for a “modular” set of calculations that the end users of the site can set themselves).
What I need to be spit out has to have just a number, no whitespace of any kind, no carriage returns, no tabs. The reason if it’s important is that the parent template is actually going to be in CSV format for exporting.
Now, I have lots of tabbing and carriage returns in my embedded template, or I will never make heads or tails of any debugging I ever have to do. So I could manually get rid of every single return and tab in the template but that route makes me SHUDDER. I will if I have to but am hoping for another solution.
I’ve tried half a dozen things suggested here and elsewhere…phpstringfun plugin…Hacksaw…etc…nothing is really working. I’m not sure if any of the ones that have complex caching systems are any use…this is going to output very unique calculations pretty often, over and over again, in rows on rows of a CSV.
Help? Please don’t make me resort to minifying the damn thing manually…granted, I could save a “working copy” with all my tabs and returns, then do a search-replace-all for the different items in my text editor, but what a pain for debug.