102 ColdBox Tips and Tricks by Luis Majano
How to Quickly Find Your ColdBox Version
Need to check which version of ColdBox you're running? There are two easy ways to do this: the CommandBox wayand the ColdBox way. Both methods give you quick access to this important information, whether you're working in the Command Line Interface (CLI) or within your ColdBox app.
Two Ways to Find Your ColdBox Version
CommandBox Way
If you’re using CommandBox, you can simply run the list command, and the version of the installed ColdBox framework will be displayed right in the console:
list
This method is fast and easy, especially when you're working from the CLI.
ColdBox Way
You can also retrieve the version directly from within your ColdBox application using the getColdBoxSetting()function. This function can be used in handlers, interceptors, layouts, or views to get any ColdBox setting. To get the version, just use the version key:
#getColdBoxSetting( 'version' )#
This method is perfect when you're debugging or need the version information in your ColdBox codebase.
+ Bonus Way Using Modules
When working with modules, you can also get the ColdBox version by accessing it via injection in your ModuleConfig.cfc. ColdBox injects the version into the variables scope, making it accessible like this:
variables.coldboxVersion
This is especially useful if you're building modules that need to adapt to different versions of ColdBox.
Why Check the ColdBox Version?
- Compatibility: Ensure you're using the correct version for specific features or settings.
- Debugging: Knowing your version can help troubleshoot issues with your application.
- Module Development: Adapt your modules to different ColdBox versions seamlessly.
Now you know how to quickly find your ColdBox version using both CommandBox and ColdBox methods. Keep these handy tips in mind next time you need to check your setup!
Learn More ColdBox Tips and Tricks
Stay tuned for more ColdBox tips in our ongoing series. if you want to learn more than 10 free tips and tricks make sure to get your “ColdBox 102 tips and tricks book” We have a variety of formats you can choose from.
Join the Ortus Community
Be part of the movement shaping the future of web development. Stay connected and receive the latest updates on, product launches, tool updates, promo services and much more.
Subscribe to our newsletter for exclusive content.
Follow Us on Social media and don’t miss any news and updates:
Add Your Comment