It looks like you're new here. If you want to get involved, click one of these buttons!
$record = $this->{base_module_model}->find_one_by_id_and_user_id($id,$user->id);
//get record from classes (base modeule model)
$record= $this->classes_model->find_one_by_id_and_user_id($id,$user->id);
$this->load->module_library('classy','bootstrap_form_builder'); //extend form-builder
$fields = $this->classes_model->form_fields();
$this->bootstrap_form_builder->set_fields($fields);
$this->bootstrap_form_builder->set_field_values($record->values());// $record->values() work but without the relationship and serialzed_fields? Can'find how this happen in admin...
....
Comments
$this->classes_model->find_one_array(array('id' => $id));
$related_vals = ( ! empty($values['id'])) ? $this->get_related_keys($values, $related_model, 'has_many', $rel_config) : array();
If you output $related_vals, is there any value?
$values = $this->classes_model->find_one_array(array('id' => $id)); $fields = $this->classes_model->form_fields($values); var_dump($fields);// return all filelds but only values of the related are setted. foreach($fields as $key=>$field){ $field['value'] = $values[$key]; } var_dump($fields); // now all are getting set correctly... but it's not so good looking :-)
In the above example the solution is working for me, because I need this loop to set some other props for the fields, but think that there is more elegant way...
Thanks for your answers. FUEL is great job.