Visit Sponsor

Written by 4:30 pm ColdFusion

MachII Includes

Recently on the Dalnet #Mach-II IRC channel, a user asked about including resources in a mach-II.xml file.

As you probably know, the MVC Framework, Mach-II, recently added an include feature. This is an excellent feature to help break up large XML file, which has been one of my previous annoyances with Mach-II. The way the new include feature works is inside an ‘includes’ tag define a resource to include.


< includes>
< include file="/some/path/to/an.xml"/>
< /includes>

Note, the extra space I added in the xml tags. This is for BlogCFC formatting and your XML file should NOT look like that..

According to the documentation, the included resource MUST be a valid Mach-II.xml document. Which means a root
<mach-ii version=”1.5.0″> tag, an <event-handlers> tag around your event-handlers and all other details for a syntactically valid mach-II.xml file. Specifically, the user left out the <event-handlers> tag around the event-handler tags inside the include and received a terse error:


EventHandler for event 'do.something' in module '' is not defined.

Wrapping the event-handler tags with <event-handlers> sorted him right out.

P.S. I am impressed with the new functionality in Mach-II 1.5. Go Team Mach-II

Visited 3,236 times, 1 visit(s) today
[mc4wp_form id="5878"]
Close