arborint wrote:ole wrote:Then yes this is a form controller as well.
What would be cool to build is an Application Contoller that did both the PHP and Javascript sides ... maybe even some Ajax stuff. But that allowed flexiblity over the source of the HTML.
That would be cool indeed, but only with really, really, really careful planning - the pitfalls are immense.
For pure Javascript that would not be too complex - pre-scripted and ready on-load. But then, I don't think Javascript in forms is really beneficial.
AJAX is really another kettle of fish. Depending on how orthodox one is with regards to MVC it creates a nice little subversive sub-MVC within an application with the potential to mess things up. Or, if carefully applied, it takes it to another level. But planning that would be a wee bit of a headache.
If you have form-validation with AJAX in mind, on-change triggered combo-boxes and transforming elements, sure.
But again, it's very easy to create an "egg-laying wool-milk-sow", i.e. something that tries to be everything, yet is somewhat of a monster. Rather have a solid, pluggable form-controller first, then add AJAX & stuff as a plug-in. That way you have a clean architecture which AJAX doesn't break, but fits into.