I have some views that I would like to store in the database and read in as required - all the render functions seem to read in the view from a file-system.
Can anyone shed some light on how I may parse in PHP code from a variable? I’ve looked at renderFile and renderInternal in the CBaseController.php class, but it’s beyond my knowledge.
You can do with eval.
Take a look at the code of renderInternal, it can help you in devloping your ‘renderViewFromDatabase’.
You have just to change this require with eval
Wow, yes you’re right. I basically just need to eval() the view “file”, and perhaps capture the output like they do in the renderInternal function. Brilliant, I’ll give it a go tonight.
Much easier than I was expecting. Thanks!