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.

view plain print about
1< includes>
2 < include file="/some/path/to/an.xml"/>
3 < /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:

view plain print about
1EventHandler 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

There are no comments for this entry.

Add Comment Subscribe to Comments