grocery crud / Ci 3 |
hi guys!!
i have value in $id. how to pass the parameter $id $user = $this->ion_auth->user()->row(); $id = $user->id; public function testeveiculos() { $crud = new grocery_CRUD(); $crud->columns('id', 'marca','modelo','cor','placa'); //$crud->collumns('id', $id)??? ...... } how would it be??
You should use where if you want to limit the results:
https://www.grocerycrud.com/documentatio...ions/where (06-18-2018, 11:54 PM)jreklund Wrote: You should use where if you want to limit the results: my problem is need id user together with the remaining do form. //Get user Ion auth $user = $this->ion_auth->user()->row(); $id = $user->id; and a function GC public function testeveiculos() { $crud = new grocery_CRUD(); $crud->set_table('veiculos'); $crud->columns('marca','modelo','cor','placa'); $crud->display_as('marca','modelo'); $crud->unset_fields('id_user'); $crud->set_subject('NOVO VEICULO'); $output = $crud->render(); $this->_example_output($output); } I need $id in esteveiculos() understood?? Sorry my english!!
06-19-2018, 08:01 AM
(This post was last modified: 06-19-2018, 08:02 AM by jreklund. Edit Reason: Added some references to docs )
You want veiculos to insert the current logged in user id?
https://www.grocerycrud.com/documentatio...ore_insert https://www.grocerycrud.com/documentatio...ore_update https://www.grocerycrud.com/documentatio...ible-field PHP Code: public function testeveiculos() (06-19-2018, 08:01 AM)jreklund Wrote: You want veiculos to insert the current logged in user id?Tanks!!!!! SOLVED! thank you so much! |
Welcome Guest, Not a member yet? Register Sign In |