2

I saw a project, in which they are doing a Dynamic build script in php that will build static html pages out of php pages. That is the html file will look exactly like the php file. The idea behind this is all the html pages will load faster and the datas will be retrieved from Webserviceses..

Also the build script will be capable of taking build for production environment tat is with min files for other environments without min files. Same with JS unit test scripts.

My Question is, is there any specific PHP framework to achieve this functionality i.e Build architecture, php to html conversion etc... Sorry if my question is so basic, I am practically little new to PHP.

Thanks in advance..

1 Answer 1

1

That sounds like something most of the templating engines do (Smarty is probably the most popular stand-alone engine). A large number of CMS systems that include a templating engine, as well as any of the larger frameworks with templating extensions, will likely do the same thing.

To achieve what you want, you pretty much can't go wrong with just about any of the major template engines, CMSes, or frameworks (which one you'd choose depends on your other needs), but the key that you'd want to look for is something along the lines of "template caching," "output caching," "view caching," or similar phrasing in the list of features for the caching capability (what you described as turning the PHP files into HTML files), and "minifying" or "compression" (note - source code compression is different from "gzip compression") for producing minified versions of files.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your answer... I will look in to smarty.. I like to know is there a build script in smarty, by which we run a php file it will convert and deploy in another location ?
You'll have to look at the documentation to be sure, but I think that (deploying to a different location) is beyond Smarty's scope. For that, you'll probably have to write a custom script, or use a CMS (content management system). If you don't want to use a CMS, it might still be worth looking at a couple to see their "install" scripts to get an idea of how to deploy to another location. Additionally, you might be able to harness your source code control to compile the templates when you push to your production server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.