klenwell information services : PhpTemplateScript

Klenwell Script Template

This is the template I use for my php scripts. It was orginally inspired by the MVC design pattern and, following that pattern, includes a controller section that triggers events based on the user input.

Some aspects of the template are tailored to the framework I use in conjunction with the codebase I've developed over the last three years. For instance, my framework automatically starts a session and opens the buffer.

Formatting is an important aspect of this template and my goal is to create a simple, logical, versatile template for php scripts. It is under constant revision, but the basic structure of the current version has been used extensively for many different types of scripts.

Schematic

// *** Documentation
// *** Pre-Script (core settings, includes)
// *** Data (triggers, flags, HTML, and other variables)
// *** Form (form constructors)
// *** Controllers (handles requests and sets event triggers)
// *** Events (trigger-controlled events)
// *** Output (set page head, dynamic HTML, blocks, and stacks for web page template)
// *** HTML Template (what the viewer will see in her browser)
// *** Post-Script (close HTML, flush buffer, and other backend operations)


Full Template

// *** Documentation
/*______________________________________________________________________________

	Klenwell PHP Script Frame Template

	Last Update: Jan 2007
	Author: Tom at klenwell@gmail.com

	SUMMARY
		Give a summary of the script here.  To summarize this template, it attempts to
		provide a cogent, structured framework for constructing web pages using the AMVC framework.
		
	NOTES
		
______________________________________________________________________________*/



CategoryPhp