Package Configuration - hashes

The hashes element is an array of key-value pairs that is mainly used to easily populate select lists and radio / checkbox lists. Each item within the array is the name of the hash, which then includes a key-value pair of all options within the hash. For example:

hashes:

  status:
     approve: Approved
    decline: Declined
    pending: Pending

  color:
    ffffff: White
    000000: Black
    00ffff: Red
    ff00ff: Green
    ffff00: Blue

The hashes can then be referenced much the same way as configuration variables. For example, if the package name is "shop", the two hashes above can be referenced as shop.status and shop.color.

Inclusion in Form Fields

You can easily populate select, radio or checkbox lists using the items of a hash by defining the data_source attribute within the HTML tag. For example:

<s:form_table>
    <s:ft_select name="status" value="decline" data_source="hash.shop.status">
</s:form_table>

The above will be replaced with a select list that contains all items of the above status hash, with "Declined" selected. For full information on this HTML tag, please visit the <s:form_field> Tag page.

Apex\App\Sys\Utils\Hashes

You may view details on all methods available to read and manage hashes by visiting the Apex\App\Sys\Utils\Hashes class section of the documentation.