[thelist] OT: Job Market

Michael Buffington mike at price.com
Wed Apr 25 16:45:57 CDT 2001


That actually works. I built a custom tag that looks like this:

<cfscript>
function CurrentMonthYear(date)
{
  DateFormat(date, 'mmmm yyyy');
} 
request.CurrentMonthYear = CurrentMonthYear;
</cfscript>

I called the custom tag in my application.cfm, and just for testing used
this to test it:

<cfoutput>#Request.CurrentMonthYear(Now())#</cfoutput>

It works of course, but just thought it would fun to test out.

The only UDF I've made so far is the CurrentMonthYear thing above, which is
no real work of programming genuis.  Just for testing.


-----Original Message-----
From: Aaron Johnson
To: Michael Buffington
Sent: 4/25/01 2:06 PM
Subject: RE: [thelist] OT: Job Market

Don't know if this would make sense or not, but one of the things we've
had
to overcome with spectra is designing object handlers that work in the
webtop and outside the webtop.  One way we've done that is to create a
global custom tag that we put in our handlers so that regardless of
where
they're run, they know of all the global information about a site...

I could see putting all your UDF's in a global custom tag that then is
invoked by application.cfm.. the custom tag then putting all your UDF's
into
the request scope... What cool UDF's have you come up with?

AJ

> -----Original Message-----
> From: Michael Buffington [mailto:mike at price.com]
> Sent: Wednesday, April 25, 2001 4:54 PM
> To: 'Aaron Johnson '
> Subject: RE: [thelist] OT: Job Market
>
>
> Good point - I knew I was missing something.
>
> I had just been playing with CF 5.0, and was using the new User
Defined
> Functions, and the only way to call a UDF that is created outside a
custom
> tag is to copy the UDF to the request scope.
>
> Passing it as an attribute makes better use of scoping.
>
> -----Original Message-----
> From: Aaron Johnson
>
> Hey Michael,
>
> No comments on the job market... but on your tip...
>
> > <tip type="ColdFusion" author="Michael Buffington">
> > Did you know that you can pass queries to a custom tag very
> > easily?  Simply
> > "copy" the query to the request scope like this:
> >
> >   <cfquery name="QueryName" datasource="#request.dsn#">
> >   exec sp_foo
> >   </cfquery>
> >   <cfset request.QueryName= QueryName>
> >
> > In your custom tag, the query will be available by refering to the
> > request.QueryName variable just as you would the original QueryName.
> > </tip>
>
>
> If you don't want to set the query to the request scope, you can also
> send
> the query to your custom tag as an attribute, which may be a bit
> cleaner...
> something like this:
>
> <cfquery name="QueryName" datasource="#request.dsn#">
> 	exec sp_foo
> </cfquery>
>
> <cf_yourcustomtag
> 	qTheQuery="#queryname#">
>
> That any other pages that run after your run your query don't see the
> request scoped query variable.
>
> Aaron Johnson, MCSE, MCP+I
> Allaire Certified ColdFusion Developer
> MINDSEYE, Inc.
> <phn>617.350.0339
> <fax>617.350.8884
> <icq>66172567
> ajohnson at mindseye.com
>




More information about the thelist mailing list