How to edit record codeigniter CRUD? |
I would like to add simple edit functionality which unfortunately was not covered in tut,I would like to have an edit button that opens a form and update info.
I followed tut from here:https://code.tutsplus.com/articles/codei...--net-6504 Here is my Contrroller: Code: <?php Code: <?php Code: <!DOCTYPE html>
The difference between creating a record and updating one is knowing the record ID that you want to update.
When updating, you can reuse the form that is used with the create methods. So just copy all the steps needed for creating a record. Add a method the get the record you want to update, and change the form so it excepts a data array containing the DB record information.
Last week we need a decision to use either Zend3 or CI3. In order to test it I used the Zend3 skeleton module which is a simple CRUD project.
here my edit function from the controller Code: public function edit($id = NULL) And here the function from the model Code: public function getByID($id) This is all very simple but hope it helps. (We did decide to use CI3 rather then Zend)
On the package it said needs Windows 7 or better. So I installed Linux.
|
Welcome Guest, Not a member yet? Register Sign In |