Hi Everyone, I hope you understand me
So I have a table about News and I change a column "publicate"(enum : y/n) with display_as "Status"(enum: Yes/No). It works on add form and edit form, but on view form it is showing "Status"(enum:y/n). I've tried to use callback_field,callback_column and doesn't work. Someone can help me?
Here is my code:
$crud->set_table('ibdfam_noticias')
->set_subject('NotÃcias do IBDFAM')
->columns('titulo','publicar','destaque','fonte')
->display_as('publicar', 'Status')
->display_as('hora', 'Data')
->fields('titulo','texto','publicar','tags','hora','fonte','destaque','image','creditos','tipo')
->field_type('publicar','dropdown',array('s' => 'Ativo', 'n' => 'Inativo'))
->field_type('destaque','dropdown',array(0 => 'Não', 1 => 'Sim'))
->callback_column('publicar',array($this,'_status'));
public function _status($value, $row)
{
if($value == 's'){
$value = 'Ativo';
}elseif($value =='n'){
$value = 'Inativo';
}
return $value;
}