TableSummaryModule::prepare PHP Method

prepare() public method

Prepares the media item for rendering. Adds column-type css classes to cells in the table.
public prepare ( ) : boolean
return boolean Whether to render the module.
    public function prepare()
    {
        // Add css classes to cells
        foreach ($this->rows as $rowKey => $row) {
            foreach ($row['cells'] as $key => $value) {
                $cellClass = self::CSS_PREFIX . '-cell-' . $key;
                if (isset($this->columns[$key]['column-class'])) {
                    $cellClass .= ' ' . $this->columns[$key]['column-class'];
                }
                $this->rows[$rowKey]['cells'][$key]['attributes']['class'] = $cellClass;
            }
        }
        return true;
    }