FW/1

ColdFusion MeetUp: A crash course in MVC with FW/1, with Steven Neiland

Our 6pm (US ET) talk on Thursday July 12 will be “A crash course in MVC with FW/1″, with Steven Neiland.

TOPIC DESCRIPTION: (provided by the speaker)

There are a lot of articles on architecture design dealing with MVC out there but most are really intellectual discussions that really are not much help for developers who are new to the whole concept. By leveraging the ease and simplicity of framework one I hope to demonstrate how to actually create a MVC application from scratch and outline some basic guidelines as to do’s, don’ts and if when’s.

MEETING URL: http://experts.adobeconnect.com/cfmeetup/

DURATION: Approx. 1 hour, plus time for questions

RECORDING: All meetings are recorded. The URL will be posted after meeting at recordings.coldfusionmeetup.com

SPEAKER: (provided by the speaker)

(John) Steven Neiland is currently the Lead Web Developer at Sterling Payment Technologies (http://www.sterlingpayment.com/) a payment processing company based in Tampa Florida.

Originally from Cork Ireland, Steven emigrated to Florida in November 2009 where he currently resides.

A self confessed computer nerd, Steven spends most of his spare time researching new technologies and writing on his blog neiland.net (http://www.neiland.net/). Occasionally he also likes to get his hands dirty either rebuilding a car engine or upgrading a computer.

When he is not working with computers Steven spends his leisure time either reading or sailing in and aroung tampa bay. Although not involved in any clubs currently, Steven used to be a keen student of karate studying for his brown belt before emigrating.

WHEN: Thurs. Jul 12, 6:00pm US ET (UTC/GMT-4)

Read More…

Using Script Loader to Load CSS and JS Dynamically on FW/1 (Framework One)

Andrew Perkins, a colleague of mine, wrote this HeaderBuilder component that comes handy when you need to load dynamically javascript and styles to your application, so each page will hold only its respective scripts.

I will show you how to use it in an application using FW/1 (Framework One) by Sean Corfield.

First thing to do is to download HeaderBuilder component, unzip it to the ‘org’ folder in your application: org.aperkins

Then instantiate the component in your Application.cfc in the SetupRequest() function, which will create the object on every request. Since this component is very simple, there are no functions in it to take care of garbage collection or clearing the object, so it is not recommended to add it in the SetupApplication as a singleton, otherwise it would continue to add scripts and styles from all controllers.

Here is the code for a sample application. Your file structure should be like this:

Sample Application File Structure

Instantiating the object in your Application.cfc:

public void function setupRequest(){
        variables.rc.oHeader = new com.aperkins.headerBuilder();
}

Setting scripts and styles in your controller:

public void function default(required struct rc){
        // add here your CSS and Javascripts for the default page
        variables.rc.oHeader.addJavaScript('/assets/scripts/dashboard.js');
        variables.rc.oHeader.addCSS('/assets/styles/dashboard.css');
        variables.rc.oHeader.setPageTitle('This is the default page');
        // write here your controller for the default page
}

Loading the scripts and styles in your layout:

<head>
	<!--- Set title from the header object --->
	<title>#application.oHeader.getPageTitle()#</title>
	<!--- Load javascript and css from the header object that is set by the controller --->
	#variables.rc.oHeader.getJavaScript()#
	#variables.rc.oHeader.getCSS()#
</head>

You may download the entire sample application here.

I hope that helps you writing neat code.

 

ColdFusion MeetUp: Simple MVC with FW/1, with Daria Norris

When:Thursday, March 3, 2011 12:00 PM
Where:Online meeting via Adobe Connect. – Meeting room: tinyurl.com/cfmeetup Online Meeting GA
Who is going: 70 ColdFusion Users
Our 12pm (US ET) talk on Thursday Mar 3 will be “Simple MVC with FW/1″, with Daria Norris.

TOPIC DESCRIPTION: (provided by the speaker)
We hear a lot about Model View Controller (MVC) and how we should use it in our applications, but how do you apply this practically in your code? Framework One provides a simple way to use MVC without overwhelming you with features you don’t know how to implement. This presentation will show how you can take your existing spaghetti code and turn it into a robust application.

Read More…