Yii For A Cms That Generates Html Files (No Php, No Cached)

I have searched the web and this forum but I have not found an answer, so I will post here. I am a total newbie to Yii while I used PHP to code sites for years.

I have a web site project that needs an ordinary CMS with PHP and MySQL, but it must generate static Html files for the public web site. I do mean simple html files, not a cache file served by PHP. There must be no calls to the php engine for the http requests regarding the front-end.

I know it sounds like --hem no, it really is!-- a silly newbie’s question and I truly apologize for that, but I don’t know where to start with doing that with Yii.

Last year I have done a similar PHP project without using a framework, but as I would like the new project to be able to expand if needed and keep the code clean and structured, I am evaluating if Yii could be the right instrument to implement it or I am just wasting my time because it’s too complex for what I have to do.


  • CMS (PHP + DB) writing/overwriting .html files on public site.

  • no DB or PHP requests on public site, just plain files served by Apache (not served by a Yii application).

Do you know if exists any tutorial or script I should look at to learn coding it?

Hi, why reinvent the wheel?

there are open source cms (frameworks) that have a static export functionality built in, like TYPO3

Thanks for your help.

I tried Typo3 12 years ago and it was a nightmare, far too much complicated. I don’t know if things are changed and know it’s easier to learn and manage. I have checked the requirements (256 Mb RAM) and I hope it does not apply to the static HTML set-up, because I don’t have.

I thought of a framework because of flexibility, I would just implement things I need. And I need two back-ends, one for the administrator and the other, very simplified, for people managing their content (text and images).

I will check TYPO3 again, do you know other reliable CMSs that produce static pages?

Learning a framework should be useful also to other projects, because I always code them myself and I need a structured path to follow (otherwise I produce a messy code only me understands).

Hi, i’m trying the same thing right now. I have been using Yii for a while now, and learned, that is capable of allmost anything.

So i came here by searching if someone actualy already did this.

I was thinking about some php output buffering.

I did think about the use of typo3, because from former projects i know it throws all the non dynamic pages into one folder for optimized speed of frontend. but typo3 is way to resource hungry to just set it up for html creation. also many hosters dont comply the resource needs.

So maybe we can find a simple solution here, maybe something we can push to a module or so for other users.

From the whole rendering process of yii i know that it must be pushing the different parts into a buffer allready. so maybe the function where it actualy starts printing out the buffer to the browser can be overwritten to instead write a file to a "statics" folder.

I will have a look at the frameworks sources later, but maybe someone who knows where to do this can help by filling in the blanks :)

FYI im doing this because a client has a low level hosting wit 20MB space, no PHP, no DB, just one Domain there. So i try to have the framework with all the content generation and setup on one server i own, but that isnt on the public internet and then on change of any of the static html files trigger a ftp push to the live server.

I am investigating :-). The proper name is static publishing, that’s the one Movable Type has always done (generating pages as .html files. It seems that SilverStripe framework - doc.silverstripe.org/framework/en/reference/staticpublisher - does it, if I understand correctly that page.

Could a remote CMS solve your problems? I am referring to CushyCMS, Unify, Pagelime, Surreal and similar.

Wow, never heard of those, thats exactly what i was thinking of, but actualy i need to host the “CMS” on my server, so my interest in finding a way to do this via Yii is still the same :)

But with such a module one could possibly try building a similar CMS as a service site …