separating api calls and templates with an included file

Would like to get some feedback on this as I’m not a server side genius. I’ve found it to be helpful for me to move almost all my api calls to one php file that I require right after the mandatory monkcms.php file at the beginning of each template.

The included file is usually about 15 to 20k.

This has allowed me to keep my HTML in the templates very brief and tidy, and makes it very easy to tweak if I want to make changes.

Another benefit of this would be portability. I hope to use the external file to help me crank out sites faster and more efficiently.

However, I want to make sure that I’m not putting any unnecessary load on the API, and not doing anything that would hamper performance. I’m not hosting my templates with Monk at this time, so I tend to do anything I can to speed up my pages.

Any drawback to this approach?

That’s a really good idea if you can really make sure that there are no unnecessary API calls. I know a good deal of PHP but for some reason never really thought to do this. In the next week I’ll try one site with this method and give you feedback on the process so we can learn from each other.

Ben

Thanks Ben, I’d be happy to give you ftp access to a site I’m implementing this on if you want to have a look.

page 1 of 1

discussions 1 to 3 of 3