Am I using this base model correctly? |
[eluser]snifty[/eluser]
I'm still trying to wrap my head around OOP in PHP, it would be great if someone could cluebat me if I'm totally off base here: I found a really nice base model which takes care of the basic CRUD functionality in models, this one: https://github.com/jamierumbelow/codeigniter-base-model Using that I've been able to remove a lot of my model code. But the docs are pretty minimal, so I'm not sure how to go about overriding one of the methods -- say, for instance, I want to customize the insert method in my application/models/foo.php: Code: class Phrase_model extends MY_Model { // MY_Model is the one from the link That seems to work -- am I on the right track? Thanks!
[eluser]Eric Barnes[/eluser]
Yes I find the way you did it the easiest. Especially when I go to view it later ![]() Another option could be to tie into the before_create part of that file.
[eluser]snifty[/eluser]
Thanks Eric! And as long as I have your attention thanks for working on Codeigniter, it's awesome. ![]() |
Welcome Guest, Not a member yet? Register Sign In |