Welcome Guest, Not a member yet? Register   Sign In
example add / edit / delete app
#11

[eluser]Andrew Gunstone[/eluser]
Ha. That is all good. It was seeing a "real" example that I was so happy about. Obviously I would also tweak the code to suit myself...fixing any of the issues along the way, adding extra validation, etc.

;-)
#12

[eluser]garrettheel[/eluser]
If you're trying to make the most out of your MVC pattern, it'd be a good idea to move the rest of those database interactions to the model. Ideally, all interaction with the database should happen in the Model, rather then in the Controller. It won't make a massive difference, but it makes it takes it a step fwurther in separating the different parts of the application.
#13

[eluser]Future Webs[/eluser]
[quote author="garrettheel" date="1228970137"]If you're trying to make the most out of your MVC pattern, it'd be a good idea to move the rest of those database interactions to the model. Ideally, all interaction with the database should happen in the Model, rather then in the Controller. It won't make a massive difference, but it makes it takes it a step further in separating the different parts of the application.[/quote]

yes my example is not using the model fully even though some code is in the model as an example. It was all a work in progress and half posted as a question and half as an example.

It would be good to have people add to it and suggest better ways of doing things
#14

[eluser]Future Webs[/eluser]
[quote author="agun" date="1228966290"]Hi guys...I am new to CI (am a big fan of EE thought!!). The code above is pretty much exactly what I needed as a good example of how to build an add/edit form... particularly around best practice of the function placement (i.e. should it go in the controller, the model, etc). I am still trying to get my head around it all, but thanks for posting ALL your code.

No question here...just a big thumbs up to both w3bm and dmorin.

:-)[/quote]

I updated the code to fix some of the errors that I had and to implement a few things that make it work better. It could still use some work but as an example to start from its ok.
#15

[eluser]Alejus[/eluser]
Great!!!
I was looking for an example like this..!
Thanks a lot.

Alejus
#16

[eluser]tim1965[/eluser]
Is the updated code in thhe example above ??
Thanks
#17

[eluser]Alejus[/eluser]
I couldnĀ“t use this example.
Have somebody another full example about create, edit and delete functions ?

Thanks a lot.

Alejus




Theme © iAndrew 2016 - Forum software by © MyBB