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
- CSV(having extra quotes in field value) to array in ColdFusion
- using some technique to fix the url
- Get number of files in various subdirectories relative to the current page - ColdFusion
- How to create a "VALID DOCX" using Coldfusion?
- Twilio Rest API Filtering using Coldfusion11
- Encoding for html in Open Graph Facebook attributes
- Embedding Image in Microsoft Word using ColdFusion
- CFMail with attachment is being sent and is in undelivr folder
- Error while Running a .exe file using coldfusion schedule task
- Coldfusion 9 serializeJSON()
- How to filter query results based on selection from dropdown list
- Display single digits with leading zero
- Coldfusion Session Timeout Application.cfc
- CFEXECUTE seems to not execute PowerShell in ColdFusion 11
- Joining SOLR Collections on ColdFusion Server
Related Questions in CFML
- How to create a "VALID DOCX" using Coldfusion?
- Coldfusion 9 serializeJSON()
- Coldfusion - How to prevent multiple clicks?
- coldfusion 9, params not found when using cfscript query
- CFC Undefined with variably defined method name
- Element xx is undefined in a CFML structure referenced as part of an expression
- railo-context/admin/web.cfm missing css in railo deployed in resin
- Coldfusion Builder 3 Coldfusion 11 Display page in Browser
- How can I replicate this loop in cfscript (for use in cf10 / railo)
- Cfscript and dynamic values
- cfimage writetobrowser functionality using cfscript
- Public-private function access via component inheritance in ColdFusion
- Listing Result by Date - showing at 8am - not midnight
- Railo View Source has a few thousand blank lines
- how to detect if string is true or false
Related Questions in FW1
- On FW/1, do I need to return after doing a redirect?
- Getting FW/1 2.2 to return application/json
- Null pointer exception on <cfthread>
- ColdFusion Converting Form Values into a Struct
- How do I return JSON from an action in FW/1?
- coldfusion fw1 (hibernate) basic join between tables - "Path expected for join!"
- FW/1 App Calling onApplicationStart on Every Request
- FW/1 How to set up multiple layouts
- Coldfusion Excel Export
- Hide FW/1 actions without controller method (view only)
- coldfusion - file content editing
- Display JSON array in Vuejs
- Using only a controller in FW1 without a view
- Returning string with diacritics
- JSON return null in ColdFusion
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 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).