To use an example, I typically will use a 'formatter' object - for formatting dates, etc. consistently in my applications. To accomplish this in a FW/1 app I have typically have a controller method I call in setUpRequest()
that will put the formatter object into the request context (rc).
For example, My setupRequest() method may look like this
function setupRequest( rc ) {
controller( 'setup.default' );
}
And in setup.default() I would have code similar to this:
component accessors="true" {
property Any formatter;
public void function default( Any rc ){
rc.formatter = formatter;
}
}
I use ColdSpring to handle my dependency injection - but I am pretty sure you can just as easily use DI/1 and not have any of this code change at all.
Then, for example, if I need to format a date in a view, I simply use this:
rc.formatter.formatDate( someObject.getSomeDate() )
You could modify this example to use different logic for your CSS, etc., put that logic into a CFC and include it in the request context (rc).