Not sure if I have missed something, with the 3.x release of ColdBox.
However, I fought trying to get a model injected into some code using
the cfproperty tag, as follows:
<cfproperty name="CustomerService" type="Model" scope="instance" />
The model is stored in the file system as /model/CustomerService.cfc,
and there is an entry in the ModelMappings.cfm as below:
Simply put, the model did not get injected into the handler. I could
go a getModel("CustomerService") and that worked fine.
So, I dug and dug through documentation (I bought the ColdBox box),
and seemed to be doing everything right. After several hours, I did
come across a "footnote" on the ColdBox site that stated the
inject="Model" should be used instead of type="Model".
I changed the cfproperty tag to the following, and magically, it
<cfproperty name="CustomerService" inject="Model" scope="instance" />
Question: Have I got it right, that with version 3.x, type="Model" no
longer works? If that is the case, definitely recommend this be
highlighted on the site, as it took me a LONG time to discover.
Superlative Solutions, Inc.
Yes, that is right, but for some reason I can’t get anything injected unless it’s in one of my Event Handlers. If I have another service layer CFC, it doesn’t seem to work for me.
If you are using the latest ColdBox 3 then you inject like this
property name=“ValidationService” inject=‘model’;
That did change in CB 3 and its being noted for documentation. I
believe that the old code was supported up through Milestone 4 and
then starting with Milestone 5 the old code would no longer work. I
know that Luis is working on a lot of documentation revisions for CB 3
as it is a big release. There are some community tickets out there to
help with documentation and updating examples and what not. I'm going
to try and work on a couple this weekend and if anyone else has any
time, head on over to the Coldbox Community space on Assembla:
It is already well documented.
From: email@example.com [mailto:firstname.lastname@example.org] On
Behalf Of Judah McAuley
Sent: Saturday, 25 September 2010 7:42 AM
Subject: Re: [coldbox:5902] Model injection using CFProperty tag
That did change in CB 3 and its being noted for documentation. I believe
the old code was supported up through Milestone 4 and then starting with
Milestone 5 the old code would no longer work. I know that Luis is working
on a lot of documentation revisions for CB 3 as it is a big release. There
Yes, I meant putting a big section on "What's changed in CB 3.0" and a
prominent note on migrating 2.6 apps
+1 Vote for any moderator to make one of these threads sticky.
If you look here:
You can see Luis mark’s tickets that break backward compatibility with a big (COMPATABILITY)
I can also see here has updated the wiki as well: