CodeIgniter Forums
CRUD Tutorial - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CRUD Tutorial (/showthread.php?tid=22658)



CRUD Tutorial - El Forum - 09-16-2009

[eluser]moos3[/eluser]
I'm looking for a good tutorial that covers this, views, model and controller, I'm teaching myself CI by writing a Note Application to replace Tomboy. I got the user part done I need help doing this part. Can anyone help?


CRUD Tutorial - El Forum - 09-16-2009

[eluser]bretticus[/eluser]
You'll probably get 10 posts with this link simultaneously Smile

http://net.tutsplus.com/videos/screencasts/codeigniter-from-scratch-day-5-crud/


CRUD Tutorial - El Forum - 09-16-2009

[eluser]wabu[/eluser]
There's also a simple example here:

http://henrihnr.wordpress.com/2009/04/26/simple-crud-application/


CRUD Tutorial - El Forum - 09-16-2009

[eluser]moos3[/eluser]
cool thanks guys. The second one was perfect. need to output json and xml for a webservice is there any tutorials about it.


CRUD Tutorial - El Forum - 09-16-2009

[eluser]vecima[/eluser]
That CRUD video cast on net+ seems like a pretty poor tutorial.

the guy hard codes the update ID and the content it would be updated to, rather than just passing one in and explaining how to select one because it would be "too much work" (what, another 2 or 3 lines of code? you already have a form!!) and uses the URI string in the model to select a record... do it that way and you have to remember to never change the uri to get to that point. why not just pass it in as a variable from the controller method? also why just go ahead and turn on global_xss_filtering? I thought that was a performance hit as opposed to doing it with input->post and escaping your data before DB entry...

has he gone mad, or am I missing something?


CRUD Tutorial - El Forum - 09-20-2009

[eluser]Robertson Freitas[/eluser]
A CRUD example with Validation, user messages and CodeIgniter 1.7.2:
http://blog.robertsonfreitas.com/2009/09/20/crud-basico-com-codeigniter-1-7-2/


CRUD Tutorial - El Forum - 09-20-2009

[eluser]bretticus[/eluser]
[quote author="vecima" date="1253172970"]That CRUD video cast on net+ seems like a pretty poor tutorial.

the guy hard codes the update ID and the content it would be updated to, rather than just passing one in and explaining how to select one because it would be "too much work" (what, another 2 or 3 lines of code? you already have a form!!) and uses the URI string in the model to select a record... do it that way and you have to remember to never change the uri to get to that point. why not just pass it in as a variable from the controller method? also why just go ahead and turn on global_xss_filtering? I thought that was a performance hit as opposed to doing it with input->post and escaping your data before DB entry...

has he gone mad, or am I missing something?[/quote]

I think the point was to show a simple CRUD example. Perhaps there should have been a disclaimer saying he wasn't using best practices. On the other hand, where else do you find a screencast example of doing CRUD in CI? Perhaps you could make a better screencast that is more complex and show best practices?


CRUD Tutorial - El Forum - 09-21-2009

[eluser]vecima[/eluser]
I'm not claiming to be a master of "CRUD" - in fact the only reason I found this thread was because I didn't know what "CRUD" stood for, and I decided to read up on it. When I watched that screencast I realized that I was already doing all of those things in my own code, and dynamically, at that. It just seemed to me that in the time he took to explain that you COULD make the data anything, but that he wasn't because it was easier not to, he almost could have just done it.

I decided to read up on "CRUD" thinking I was missing out on the latest web programming technique (like "AJAX" or something). It turns out I just wasn't versed in the keyword lingo. I had already implemented "CRUD" out of basic functional necessity.

It seems silly to call it "CRUD". I call it common senese.