Dictionaries

Snowman provides a set of functions for working with dictionaries (also known as maps or associative arrays). These functions allow you to create, manipulate, and query dictionary data structures in your templates.

Dictionaries are useful for organizing related data, building dynamic structures, and transforming data during template rendering.

Available Functions

  • dict_create - Create a new dictionary from key-value pairs
  • dict_get - Get a value from a dictionary by key
  • dict_set - Set a key-value pair in a dictionary
  • dict_unset - Remove a key from a dictionary
  • dict_has_key - Check if a dictionary contains a key
  • dict_keys - Get all keys from one or more dictionaries
  • dict_values - Get all values from a dictionary
  • dict_pick - Create a new dictionary with only specified keys
  • dict_omit - Create a new dictionary excluding specified keys
  • dict_pluck - Extract values for a specific key from multiple dictionaries
  • dict_find - Navigate nested dictionaries safely with a default value