As foo?string: This will convert the boolean to string using the default strings for representing true and false values. By default, true is rendered as "true" and false is rendered as "false". This is mostly useful if you generate source code with FreeMarker, since the values are not locale (language, country) sensitive. To change these default strings, you can use the boolean_format setting. Note, that if the variable is multi-type variable that is both boolean and string, then the string value of the variable will be returned.