My system need as dynamic table name, because every module have your table like: mod_facebook_like_box....
public function index() {
$this->grocery_crud->set_table ( 'modulos' );
$this->grocery_crud->set_relation ( 'tipo_de_modulo', 'componentes', 'titulo' );
$this->grocery_crud->field_type ( 'status', 'dropdown', array (
'0' => 'Despublicado',
'1' => 'Publicado'
) );
$this->grocery_crud->field_type ( 'mostrar_titulo', 'dropdown', array (
'0' => 'Não',
'1' => 'Sim'
) );
$this->grocery_crud->set_relation('configure',"{DYNAMIC FROM _get_table}",'title');
$output = $this->grocery_crud->render ();
$this->saida ( $output );
}
public function _get_table($value, $row){
$this->load->model ( 'modulos_model' );
$classe = $this->modulos_model->select ($row->tipo_de_modulo);
$tabela = "mod_" . strtolower ( $classe );
return $tabela;
}
Any sugestion?
Sorry for my english.