Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In some cases you may want the data for a particular column to be transformed in some way before it is output to the page.

Example

For example, the hidden column in the course table contains either a 0 (for visible) or 1 (for hidden). If you wanted to create a column that displays the visibility status to a user, it would be better for the column to contain the words 'Visible' and 'Hidden' rather than 0 and 1.

...

There are a number of pre-defined display functions available to source creators. See predefined common options.

Formatting strings from the database

Prior to 1.1.10 it was the display functions responsibility to do any filtering on data from the database. From 1.1.10 onwards, report builder automatically passes the first argument through filter_string() to ensure multilang filters are applied. The 2nd argument is still raw from the database so any data from that object needs to be filtered.