lime icon

Phosphorus and Lime

A Developer's Broadsheet

This blog has been deprecated. Please visit my new blog at klenwell.com/press.
PHP: next version of form wizard
Had an idea in the shower today on how to restructure the form field constructors in the next version of my form wizard:

Currently, in MVC terms, model, controller, and viewer are all handled by the constructor function. The function can either immediately echo the html that's produced after the data is validated and formatted, or it can return it for later display. The default setting is not to echo and this is usually necessary, especially if I intend to do any further post-function validation or manipulation of the data before displaying the form field html.

Given this reality, it would probably make more sense for the constructor simply to represent the data dimension of the form field and then write another function, e.g. display_field($name) or display_cx($name), to display it.