Add view helpers and read the config in views
Functions registered in DEF.helpers are available in every view as helpers.name(...). Use them for formatting that you repeat (prices, dates, labels).
Settings from the config file are printed with @{'%key'}, for example @{'%name'} for the name setting, so the view does not need access to CONF.
name : Forge shopDEF.helpers.price = function(value) {
return '$' + value.toFixed(2);
};@{layout('')}
<h1>@{'%name'}</h1>
<p class="price">@{helpers.price(model.price)}</p>exports.install = function() {
ROUTE('GET /', page);
};
function page($) {
$.view('index', { price: 9.5 });
}