Good call Rob. Although if the framework injected the event into the helper
is that really that much different to you doing it? It's still very MG
specific as the helper has to know about the event structure however it gets
into it.

I think it's the fact that this is for the view layer that it feels slightly
odd. May be worth thinking more in terms of framework independence and just
passing in what is needed for the method to do it's rendering - then you
aren't tied to MG and can use the helper in other frameworks etc.

 

---

James  Allen

E: [email protected]

Blog: http://jamesallen.name

Twitter: @CFJamesAllen (Coldfusion / Web development)

Twitter: @jamesallenuk (General)

Twitter: @JamesAllenVoice (Voiceover)

 

Tune in to the best in community radio - Codebass Radio:
http://codebassradio.net

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Robert Rawlins
Sent: 26 October 2011 12:34
To: [email protected]
Subject: Re: [Model-Glue] Accessing the event context within a helper

 

Hi James,

 

You're quite right. I could use a custom_tag for this, I just chose to use a
UDF as i'm more familiar with that.

 

I can just pass the event in as an argument to the method, something about
that just didn't feel quiet right, I would much rather have access to the
event direct within the helpers, perhaps pre-injected by the framework or
something. I wasn't sure if something like that was going on under the hood.

 

Thanks bud.

 

Robert

 

On 26 Oct 2011, at 12:27, James Allen wrote:





Hi Rob,

 

This nicely follows on from Twitter yesterday. Why not use custom tags
instead of helpers here? Then you can just pass in the event structure or
individual pieces of data into the custom tag within the relevant views.

 

Although, equally can't you just pass in data to the helper method or the
event structure itself? I haven't used helpers myself but they are just
UDF's accessed via the event scope right?

 

James.

 

---

James  Allen

E: [email protected]

Blog: http://jamesallen.name

Twitter: @CFJamesAllen (Coldfusion / Web development)

Twitter: @jamesallenuk (General)

Twitter: @JamesAllenVoice (Voiceover)

 

Tune in to the best in community radio - Codebass Radio:
http://codebassradio.net

 

From: [email protected] [mailto:[email protected]] On
Behalf Of Rawlins
Sent: 26 October 2011 12:08
To: [email protected]
Subject: [Model-Glue] Accessing the event context within a helper

 

Hello Guys,

 

I'm putting together some helpers which will be generating HTML markup for
me. Part of this markup will be creating links. (event.linkTo)

 

I need access to the current event context from within the helper for doing
this. Is this possible at all?

 

If not, what's the best way to achieve it?

 

Thanks.

 

Robert

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
 
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

 

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
 
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

 

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog
 
You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

-- 
Model-Glue Sites:
Home Page: http://www.model-glue.com
Documentation: http://docs.model-glue.com
Bug Tracker: http://bugs.model-glue.com
Blog: http://www.model-glue.com/blog

You received this message because you are subscribed to the Google
Groups "model-glue" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/model-glue?hl=en

Reply via email to