Wednesday, September 23, 2009

Model Glue - Variable CTRLINST is undefined

I'm playing around with Model Glue 3 (gesture) and event-types and message handling etc, and I ran across a nasty little productivity stopper.

I had defined an 'init' method which did nothing in my Model-Glue Controller for one of my controllers. I was getting a very obscure 'Variable CTRLINST is undefined.' message as a result.

<cffunction name="init" output="false" access="public" returntype="void" hint="">
<cfreturn />
</cffunction>


Removing the 'init' method from the controller solved the problem, and the error message went away - leaving me to run my application once again.

I had become so accustomed to putting an 'init' method regardless in all cfc's that If I had not had some prior controller code to look at - I would have been sitting on this error for a long time.

Hope this helps someone out there - Maybe a more appropriate message here would help (framework guys).

4 comments:

Brian Swartzfager said...

If you post about the error in the Model-Glue Google group (http://groups.google.com/group/model-glue), I'm sure they'll take a look at it. They responded to the problem I was having rather quickly.

Will Belden said...

I'm a Coldbox guy, not a MG guy. However, did you need a super:init() call in there?

Ryan TJ said...

Your contoller in MG extends another cfc from the MG framework. That base cfc has an init method so if you have an init method then you would need a super.inti() in your init method.

Anonymous said...
This comment has been removed by a blog administrator.