Passionate Development From Journeyman to Master

Model Glue #3

I think I made some progress in my understanding on my Model Glue project.

For the back-end (admin stuff), scaffolding really helps, because back-end work for my site is mainly for data entry for product table. I’m wondering how useful scaffolding would be for more complicated data entry (ie updating multiple tables for instance).

My biggest problem with Model Glue was how can I access data in my database, as this wasn’t explained in the tutorial. Luckily I read some articles by Joe in Fusion Authority Magazine. There are some Model glue messages that can be used for this purpose, for example this code snippet below is to display a single product.

     		<event-handler name="front.product.view" access="public">
			<broadcasts>
				<message name="ModelGlue.genericRead">
					<argument name="recordName" value="productRecord" />
					<argument name="criteria" value="id" />
					<argument name="object" value="product" />
				</message>
			</broadcasts>
			<views>
				<view name="body" template="dspSingleProduct.cfm" append="true">
					<value name="xe.add" value="front.product.add" overwrite="true" />
					<value name="xe.list" value="front.product.list" overwrite="true" />
				</view>
			</views>
			<results>
				<result name="" do="view.template" redirect="false" append="" preserveState="true" />
			</results>
		</event-handler>

uncategorized