• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
CRUD Tutorial

#1
[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?

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

http://net.tutsplus.com/videos/screencas...ay-5-crud/

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

http://henrihnr.wordpress.com/2009/04/26...plication/

#4
[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.

#5
[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?

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

#7
[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?

#8
[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.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.