See Release Notes
Long Term Support Release
Differences Between: [Versions 401 and 403]
Adds export_for_template behaviour to an mform element in a consistent and predictable way.
Copyright: | 2016 Damyon Wiese |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 95 lines (4 kb) |
Included or required: | 20 times |
Referenced: | 0 times |
Includes or requires: | 1 file lib/outputcomponents.php |
export_for_template(renderer_base $output) X-Ref |
Function to export the renderer data in a format that is suitable for a mustache template. This means: 1. No complex types - only stdClass, array, int, string, float, bool 2. Any additional info that is required for the template is pre-calculated (e.g. capability checks). This trait can be used as-is for simple form elements - or imported with a different name so it can be extended with additional context variables before being returned. param: renderer_base $output Used to do a final render of any components that need to be rendered for export. return: stdClass|array |