/** * Add a column to the model * * @param mr_html_table_column $column The column object * @return mr_html_table_column_dynamic */ public function add_column($column) { $this->columns[$column->get_name()] = $column; return $this; }
/** * Add a table column * * @param mixed $name Column SQL field name (see mr_html_table_column) OR * an instance of mr_html_table_column. If the latter, * than $heading and $config are ignored. * @param string $heading Column heading * @param array $config Column configuration * @return mr_html_table */ public function add_column($name, $heading = '', $config = array()) { if ($name instanceof mr_html_table_column) { $column = $name; } else { $column = new mr_html_table_column($name, $heading, $config); } $this->columns[$column->get_name()] = $column; return $this; }