Auto CRUD Generator - #2 - Add & Edit Forms Generation w/ Validation and More | CodeIgniter 4
ฝัง
- เผยแพร่เมื่อ 2 ธ.ค. 2024
- In this second part of the tutorial we will continue working on Auto CRUD Generator and will expand the the existing code to Generate Add Form and Edit Form completely automatically just by setting some very basic stuff. This is where the magic begins.
GitHub Helper Files Repository: github.com/ale...
In this part of the "Auto CRUD Generator for CodeIgniter 4" tutorial you will learn:
How to create an 'Add' Form
How to create an 'Edit' Form
How to define validation rules
How to define fields to show or hide fields from the forms
How to style your form using 'class' option
Auto CRUD Generator for CodeIgniter 4 is a Library that will auto generate Create/Read/Update/Delete functionality for your CRUD operations, based on the provided options from your Controller.
This project is especially helpful to the back-end developers who deal with Forms and Validations constantly.
Auto CRUD Library for CodeIgniter 4 Repository: github.com/ale...
Thanks for the tutorial and projects. Very helpful Alex
one more perfectly explained video on latest version of codeigniter 4, thank you Alex Lancer very profesional lessons
What I like the most about this tutorial series is the absolute lack of nonsense. No distracting music or leaving us to guess what is happening behind the code. The fact that it is not scripted should make every CI4 newcomer feel relieved that we are not alone in our frustrations when we forget the little things. In fact, watching Alex patiently debug his code is perhaps one of the most important takeaways from his tutorials. Kudos to you, Alex! I know it is not easy to make these types of tutorials in a single go. THANK YOU!
Good work Brother.
Awesome, thanks for the bonus.
This is what I waiting for. Best Alex. Thank you!
Yeah :) The heavy stuff. Takes some time to be created. But it's worth the time spent.
@@AlexLancer Yap. So Alex, it will be support to multiple upload image?
@@EvanAbaddon not out of the box. Because there is no standard way for image upload + storing. If you have ideas on how to implement it. Share with me and I will consider adding it to the library.
@@AlexLancer For example we have table Products and the product have many images (id_album). and we have another table call Gallery or album it will relation with Products table.
@@EvanAbaddon that's how I do it also.Will have to plan it and research a little bit.
Hi, Alex!!
Thank you a lot for your tutorials!! really good help! I've generated CRUD encrypting some fields with codeigniter4, but I want to do a findAll() method and show it in a table inside a view and I don't know how to do it.
without encrypting, it's easier making findall(), and then a foreach loop, but now I'm stacked because of the encryption of some fields.
Thank you very much for you help!
I'm totally stuck
No matter what I do I still get this error:
ErrorException
Array to string conversion
is there any other way to fix this other than using this code:
if (is_array($form) && isset($form['redirect']))
return redirect()->to($form['redirect']);
this method doesn't work ;(
I had the same problem!
hi alex, when i compare password, it's cant match, $post[$hashIt] = password_hash($hashIt, PASSWORD_DEFAULT); password_hash($data['data']['u_password'], PASSWORD_DEFAULT);
password_verify($data['u_password'], $user['u_password']);
it not true, i set pw, and not login with my password.
May you help me, thanks u.
i fixed bug. $post[$hashIt] = password_hash($post[$hashIt], PASSWORD_DEFAULT); for anyone need fix.
@@vuphungduy595 THANK YOU !!! Without this adjustment that you made, what happened was that it was recorded and the password was never found correctly. 12 hours searching....Thank You !
appreciate for great help to make our life easier and save the development time. looking for a dynamic menu (based on table(s)) and menu management which have At Least 4 levels of submenus, please if have time, guide us How To? i googled but still failed to find. regards
Hi Alex,
Thanks for your sharing. I just finished part two of your tutorial. It seems that the search filter doesn't work with pagination, ie. search, click page number and search filter clear automatically. Is there anything i miss in the tutorial ?
Note: After I finished with Part 3, I know that this is a know bug to be fixed.
Exactly, it is something that needs to be figured out.
Hi Alex,
Thanks for this tutorial. It really helps me a lot
I need Delete row option. Can you tell me how to do that?
Hey, Deva,
So far I am convinced that there is no reason to automate the deletion process. And the reason for that is that many deletions procedures might need some unique business logic. Therefore, it is more appropriate, in my opinion, to do it on your own, depending on your project needs. Just add a delete method into you controller function delete($id) and once deleted redirect back to the index method to display the table with existing items.
Or create your own delete method in Crud.php file with all the required checks for your needs.
@@AlexLancer Thank you so much for your response Alex. I saw some code relevant to delete option in Crud_core.php that's why I asked.
I can do it by myself 😊.
my datepicker does not work.. what did i miss
hi, BRo............... the best teach for me thank... I need more for to learn so can you make a video about upload and download file manager for (pdf, img) or all ext include .apk ext.. thank bro
$form .= '
' . ($this->action == 'add' ? $this->form_title_add : $this->form_title_update) . '
' . form_open('/'.$this->base . '/' . $this->table . '/' . ($this->action == 'add' ? 'add' : 'edit/' . $this->id)) . '
';
for some reason, this code doesn't redirect me to the /users/add or users/edit. but when I type the URL in the search bar the form loads. any tips on how to fix this? thankyou
nvm . i fix it :)
Show theater.. vlw...
:)