I'm writing a magento extension and I need to have a phtml template file that is fetched from an external source. It can change remotely.
Currently I'm using http requests to get the file, and then php file access (
file_put_contents()) to write it.
However this method sound kinda risky and 'wrong'. I feel like caching might do some problems and sites that have cluster of servers might not sync those files between them (and maybe other weird behaviors).
So my question is this:
- Is there a "magento" why to programatically change phtml files?
- If not, do you see any serious dangers / faults with my current implementation?
I know it sound weird to change phtml files but that's what I need to do. Using the block functions just won't cut it (I need a totally different html file that dynamically changes without any firm template I can relay on. I guess I could do the entire phtml is just a call to a block function that returns everything, but that sound silly).