CodeIgniter Forums
Writing Static HTML files - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Writing Static HTML files (/showthread.php?tid=11756)



Writing Static HTML files - El Forum - 09-22-2008

[eluser]Keyur Shah[/eluser]
I have a product catalog, and would like to write out the final full html of each product to a static html file (i.e. widget-green.html ). I would like to create the physical file and not interested at this point in using a cache or rewriting a html extension.

Wondering if this can be done and at which step in the MVC the full html page code can be grabbed and written out.

I'm new to all this, coming from Smarty and it's easy to do it in there, but now sure how to do that in CI.

Thanks!


Writing Static HTML files - El Forum - 09-22-2008

[eluser]sophistry[/eluser]
welcome to CI:

there is a function you can put in any controller called _output() and it will receive the generated output that would otherwise have been rendered and sent directly to the browser.

http://ellislab.com/codeigniter/user-guide/general/controllers.html#output

alternatively, check out the output class http://ellislab.com/codeigniter/user-guide/libraries/output.html for more comprehensive control.

you could also look into hooks.


Writing Static HTML files - El Forum - 09-22-2008

[eluser]Keyur Shah[/eluser]
great, that helps so much.

appreciate the help.