I'm learning the FW/1 framework and so far so good. I understand mostly how controllers/services/views work. However I have some additional functions that manipulate the views in some cases i.e. alter the CSS and layout depending on what is returned to the view. Where is the best place to add this functions to make them accessible by the view?
FW/1 Best place to put additional functions?
653 Views Asked by Shaun Perry At
1
There are 1 best solutions below
Related Questions in COLDFUSION
- Is there a way to get a dynamically generated QR to print on a badge card?
- "Apache2 Syntax Error: Cannot load mod_jrun22.so - undefined symbol: ap_log_error"
- Getting Java Error - java.lang.reflect.InaccessibleObjectException: Unable to make public sun.util.calendar.ZoneInfo(java.lang.String,int) accessible
- Unreadable text - dialog with goofy robot icon in VS Code
- Cold Fusion Custom Tags How To Block generatedContent if executionMode eq start
- Coldfusion SOAP API, name of parameters on wsdl changes to generic one
- passing multiple values with comma seperation in cfqueryparam causing issue. it is paasing as index scan instead of index seek
- ColdFusion app " Error Executing Database Query. Access denied for user" for RDS mySQL
- Why is CFTHREAD resuing local variable values in a loop?
- jquery validation code working but ending up uploaading same files in both different folders
- Encountering 'Error invoking CFC for gateway file: null
- cfspreadhseet - how to delete/update a comment in the cell?
- ColdFusion - page with CFCHART inserts JS into HTML <head> - Test and Prod servers it is at top of <head> my local is at bottom and causes JS conflict
- How do I decrypt an encrypted private key in ColdFusion?
- Does Coldfusion 2021 support connections to MySQL 8.0? (AWS RDS MySQL Community Server)
Related Questions in CFML
- Escaped & Breaking SQL Response
- cfspreadhseet - how to delete/update a comment in the cell?
- How do I decrypt an encrypted private key in ColdFusion?
- forcing new line in a text box thats populated programmatically (Lucee cfml)
- Trying to parse JSON with Coldfusion and running into structural problems
- CFHTTP ERROR : Connection Failure. Status code unavailable
- Evaluate() function in coldfusion is not working
- ColdFusion returning an error when using the Java MAPIMessage object
- How to calculate summation of square of numbers in array in CFML
- Coldfusion - runAsnyc method not allowing the instantiation of Beans
- How do you add a Login with Steam button to a coldFusion website?
- Create Copy To Clipboard In ColdFusion
- ColdFusion 2023 FileRead throwing a 500 error
- VS Code Beautify CFM - cfset tags
- CFHTTP ReCaptcha V3 Error with Connection
Related Questions in FW1
- Coldfusion Excel Export
- FW/1 How to set up multiple layouts
- FW/1 How to return ajax data without view?
- FW/1 Controller changes not updating in view
- I'm getting a pdf in my Api Response, but angular is not able to download it , because subscribe is not able to grab a response on type pdf
- How ColdFusion framework ONE making view function available in views
- fw/1 - Can not display foreign characters in views
- Render JSON from controller method
- Coldfusion can not insert date type into MySQL
- Fw/1(Lucee) - Ajax request failed by CORS policy in Framework7
- Returning string with diacritics
- JSON return null in ColdFusion
- Axios and FW/1 unable to use headers (CORS error)
- ColdFusion forcing CSRF to fail
- Need explanation for 'convention over configuration'
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
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
And in setup.default() I would have code similar to this:
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:
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).