I’m a web developer new to Lucee and CFML, and as soon as I started exploring the features present in these technologies I’ve found out how easy and straight forward it is to develop data-driven web apps with them.
But I came across a thing that I personally consider an issue. If I wanted to define page encoding, I had to use in every template I used in my application. The same way, I had to use the same tag to remove white spaces. Yes, I discovered that I could change the settings of default encoding and spaces directly in the server panel, but I was wondering why not allow that to be set per application in the Application.cfc like this:
Another thing is create the ability to bypass some tags when it comes to white spaces in which would be interesting to maintain them such as “<pre>” for instance.
Hi Jhonatan, welcome to our community. Really great to see new members here around showing such enthusiasm and energy
I think your proposal is a great idea, and I think that would be a really nice to have. Don’t know if anybody of the lucee team thought already about it.
There are some different ways to do what you want to do. If I remember it correctly, some of these tags/ways (e.g. <cfprocessingdirective> or <cfsilent> ) come from a time even before components and application.cfc existed in cfml. When the modern application.cfc ( the old one was a simple application.cfm file) arrived, we developers adopted that whitespace directive tags to simply run in the code inside of our apps. But then there came the modern application.cfc and many settings of the coldfusion administrator, have been pushed to be also configurable inside of the application.cfc ( one example is also database DSN configuration). If I remember it correctly, I think Railo/Lucee was the cfengine who first did that.
One more thing: For using such tags that should work in every single page, you can call them to work directly in the application.cfc, because application.cfc has pre- and post-processors functions for your templates. You could also do it like the old classic way with cfinclude files, but I wouldn’t recommend that. However, it depends on your apps need and preference. Of course, from the perspective you’ve already mentioned, I share your opinion about having also such a setting there.