The dotcase helper converts a string to dot.case format by replacing spaces, dashes, underscores, and other non-word characters with periods and lowercasing the result. Use it to generate configuration keys, settings names, or other dot-separated identifiers.
Syntax
{{dotcase value}}
value -- The string to convert. Required. Non-string inputs (numbers, booleans) are converted to strings before processing. Arrays of primitive values are converted to a comma-separated string before processing. Objects and object arrays produce unusable output.
Examples
Convert a mixed-separator string
{{dotcase record.category.label}}
Input:
{ "record": { "category": { "label": "a-b-c d_e" } } }
Output: a.b.c.d.e
Existing hyphens, spaces, and underscores are all normalized to a single ..
Convert a space-separated string
{{dotcase record.section}}
Input:
{ "record": { "section": "Customer Profile Data" } }
Output: customer.profile.data
Split at camelCase boundaries
{{dotcase "getUserProfile"}}
Output: get.user.profile
The helper inserts periods at camelCase and PascalCase word boundaries.
Usage notes
- All word separators (spaces, dashes, underscores, and other non-word characters) are normalized to a single
.. - Multiple consecutive separators are collapsed into a single period.
- The output is always lowercased.
- Periods are inserted at camelCase and PascalCase boundaries.
- Do not pass objects or object arrays -- the output will be unusable.