Mach-II/Mach-II-Framework — Issue #56: Provide mixins for views
Author: mpwoodward
Created: 2012-03-01 18:26:20+00:00
State: open
Labels: enhancement

(Moved from http://trac.mach-ii.com/machii/ticket/227)

Provide a way to mixin for views in helper style CFCs into the view context. These helpers might be the HtmlHelperProperty, UdfHelperProperty or other CFC defined by a developer. We'll also need a mixin helper cfc that can pull into the request functions from a target CFC by explicit list or by reading CFC metadata.

Mixins shouldn't be mixed into the ViewContext as the mixins need to be hierarchical in nature (meaning parent modules are loaded first with mixins from the module second) and if we mix them into the ViewContext it will pollute the other methods in the context. We should use a ViewRender.cfm in which we can pass the mixin structure in by calling the ViewRender.cfm using cfmodule. The ViewRender.cfm is the file that actually uses cfinclude to execute the request view .cfm file.

Mixins should be a last one loaded wins when a namespace conflict occurs.