Blog

The Global View Helper

Luis Majano February 17, 2015

Spread the word

Luis Majano

February 17, 2015

Spread the word


Share your thoughts

Since the early ColdBox 2 versions we had the ability to declare helpers for our layouts and views by creating a file right next to the view and adding the suffix Helper to it.  This would allow the framework to bind the two templates together at run-time.  This is a great way to provide further separation by convention.  However, there was no way to affect layouts and views globally.  You only had the global application helper which injected functions and variables to handlers, layouts and views.

In ColdBox 4 you have a setting viewsHelper which is a template that will be injected and bonded to any layout/view that is rendered. This means that finally you have a template that can be globally available to any view/layout in your system.  This is a great way for you to add your own functions for things like i18n, localization, and much more.


coldbox = {
    viewsHelper = "includes/helpers/ViewHelper.cfm"
};

Enjoy!

Add Your Comment

Recent Entries

BoxLang AI v2.1.0: Enterprise-Grade Multi-Tenancy, OpenSearch, and AWS Bedrock Support

BoxLang AI v2.1.0: Enterprise-Grade Multi-Tenancy, OpenSearch, and AWS Bedrock Support

We're excited to announce BoxLang AI v2.1.0, a major release that brings enterprise-grade features to your AI-powered applications. This release focuses on production readiness with multi-tenant usage tracking, scalable OpenSearch vector memory, complete AWS Bedrock integration, and simplified provider configuration.

Luis Majano
Luis Majano
February 04, 2026