CI4: create single view (modal / non-modal) for both Add/Edit |
(04-07-2022, 09:57 PM)Ahmed Haroon Wrote: as seniors know about i have just started learning using CI4 as recommended by @InsiteFX, so may be the question is worthless. anyway, i am trying following different guides, today i started seeing this Guide , here he created a modal form with method="post" at around 01:50 , so question arise that is there a way i can create a Single View for both methods Add & Edit "post" & "put" ? if so, please have a link to the guide from where i can create a single modal form for both operations. 1. I Create 4 layout: default (for list table, consists data tabel, detail btn, edit, and delete), index for list table, headform for reusable form Modal, and show/edit for data detail content. 2. I use "include('layouts/headform')" after delete and Edit button. 3. In headform.php file I use staticBackdrop Form Modal and write "include($detailData) in body. $detailData is declared in the controller as array data of each controller. So, I can use reusable headform.php to call Form Modal for Add/Detail/Edit in Table List View. And I can re-use it to different data like Task Detail, Employee Detail...and so on. |
Welcome Guest, Not a member yet? Register Sign In |