Search the web
Sign In
New User? Sign Up
fusebox5
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Message search is now enhanced, find messages faster. Take it for a spin.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
App method - works in display template, not in model cfc.   Message List  
Reply | Forward Message #4278 of 4484 |
Re: [fusebox5] App method - works in display template, not in model cfc.

On Mon, Jun 22, 2009 at 2:15 PM,
the_one_true_dave_anderson<dave@...> wrote:
> I have a FB5.5 app (with an xml-less config), and there's a function in my
> App.cfc called isProduction() that returns a boolean value. I had been
> setting an application.mode variable (to 'prod' or 'dev') based on the value
> returned by this function, but recently discovered (!) that I could call
> isProduction() from pretty much anywhere. However, after recently deploying
> updates to a testing environment, I found that the function would not
> execute in one of my Model cfc's -- though worked fine in display templates.
> I did/do not have this problem on my local dev environment.

I'm surprised you can call Application.isProduction() from a model CFC
in your local dev environment.

Yes, the variables scope of Application.cfc is available in your
views. It's also available as myFusebox.variables() which you could
use in the controllers (or model circuit if you're using a Fusebox
circuit for the model rather than standalone CFCs).

That said, I really wouldn't recommend this sort of thing. Relying on
Application.cfc methods being available "everywhere" is not very well
structured, to say the least. Application.cfc is meant to handle the
lifecycle of the application: startup/shutdown for application /
session / request. It's not meant to be a 'kitchen sink' for utility
methods.

What I typically do is have some sort of configuration CFC that
encapsulates all the differences between dev / qa / prod / etc as much
as possible and then make that available to other components as needed
(storing it in myFusebox.getApplicationData() for use in views and
controllers and then initializing the model with a reference to that
config CFC as appropriate).
--
Sean A Corfield -- (904) 302-SEAN
Railo Technologies US -- http://getrailo.com/
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood



Mon Jun 22, 2009 9:47 pm

seancorfield
Offline Offline
Send Email Send Email

Forward
Message #4278 of 4484 |
Expand Messages Author Sort by Date

This is an elusive problem for which I've already instituted a workaround, so it's not terribly urgent, but quite vexing nevertheless... I have a FB5.5 app...
the_one_true_dave_and...
the_one_true...
Offline Send Email
Jun 22, 2009
9:15 pm

I think it pertains to scoping/visibility of "variables.*" from within CFCs... I came across that one as well (except I was creating the method in...
Tim Mixell
tim.mixell
Offline Send Email
Jun 22, 2009
9:26 pm

On Mon, Jun 22, 2009 at 2:15 PM, ... I'm surprised you can call Application.isProduction() from a model CFC in your local dev environment. Yes, the variables...
Sean Corfield
seancorfield
Offline Send Email
Jun 22, 2009
9:47 pm

... You should be! I was mistaken! I thought it worked in my local dev env because I hadn't encountered the error, but it was there. ... I absolutely agree....
the_one_true_dave_and...
the_one_true...
Offline Send Email
Jun 26, 2009
2:00 pm

On Fri, Jun 26, 2009 at 7:00 AM, ... OK, you had me worried for a bit there! :) ... Thank you! It's always good to hear when an open source project you've...
Sean Corfield
seancorfield
Offline Send Email
Jun 28, 2009
4:36 am

Is there any place where I can sign up for a class on fusebox....kind of walk through an application from start to finish? I am reading the Fusebox: ...
Eva
abelledenuit
Offline Send Email
Jun 28, 2009
4:34 am

... I'd be interested to hear what people recommend on Fusebox training. I've heard of some very bad experiences with TeraTech Fusebox courses so this is a...
Sean Corfield
seancorfield
Offline Send Email
Jun 28, 2009
4:38 am

So I take it from the silence that there isn't any place to learn Fusebox. Everyone for themselves kind of deal, not sure why it is so popular then. I like the...
Eva
abelledenuit
Offline Send Email
Jul 3, 2009
2:21 am

I'm not familiar with formal training venues, with that said - I think you found a good resource here. This group, the documentation, and the forums have been...
Seth Johnson
cfx_user
Offline Send Email
Jul 3, 2009
4:09 am

Fusebox is a simple, easy to use framework that works very good. Thats why it is so popular. The nuts and bolts are rather easy to understand. You shouldn't...
Kevin Pepperman
lbretail22
Offline Send Email
Jul 3, 2009
5:30 am

Aw but when you are looking for a job, the question always comes up did you take a class or how did you learn to use fusebox. If you take a class then that...
Eva
abelledenuit
Offline Send Email
Jul 3, 2009
4:32 pm

... That may be true (the opposite for me actually), but what Kevin said was correct. Fusebox is easy to learn with the documentation on the site and sample...
Phillip Vector
lance_lake
Online Now Send Email
Jul 3, 2009
4:44 pm

You can place the core files anywhere you want and create a CF mapping to them. Then call them from any app root. Seth From: fusebox5@yahoogroups.com...
Seth Johnson
cfx_user
Offline Send Email
Jul 3, 2009
4:54 pm

Eva, I wholeheartedly agree that it's hard to get into. In fact, most of the frameworks are. This has been a pretty awful block for a long time. This is what I...
Nathan Strutz
nathan_strutz
Offline Send Email
Jul 4, 2009
6:39 pm

Yes, exactly. I feel awkward asking about things here cause everyone seems to be doing this for a while....and the answers kind of imply that you should have...
Eva
abelledenuit
Offline Send Email
Jul 5, 2009
3:35 am

Don't hesitate to ask questions. You're correct that a lot of questions on this list are about in-depth, nitty-gritty stuff, but don't let that deter you....
Barney Boisvert
barneyboisvert
Offline Send Email
Jul 5, 2009
5:34 am

Expanding on what Barney says, it is possible to "help yourself" as well as waiting for answers from other, more informed users. I highly, highly recommend...
Mike Ritchie
starkraving2002
Online Now Send Email
Jul 5, 2009
8:16 am

I second Mike – get Jeff Peter’s books. I pretty much make that required reading for anyone on my team who is struggling with Fusebox. Adam Bellas | Sr....
Bellas, Adam
vurcease
Offline Send Email
Jul 7, 2009
1:07 pm

I agree Jeff's books are extremely helpful. ... I agree Jeff's books are extremely helpful. On Jul 7, 2009, at 6:05 AM, Bellas, Adam wrote: I second Mike –...
Jeffrey Roberson
hippiex
Offline Send Email
Jul 7, 2009
3:36 pm

I had this same question as I was recently getting ready to develop my first FB5 app. If you have no budget (pretty common these days) there really isn't much ...
Dan LeGate
dlegate
Offline Send Email
Jul 7, 2009
5:32 am
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help