Extending CI_MODEL but nothing.... |
[eluser]andreffonseca[/eluser]
Hi people... I've done some debugging and for some reason not known to me the __get method of the class CI_Model is never called... I'm completely lost....
[eluser]TheFuzzy0ne[/eluser]
That doesn't surprise me, since CodeIgniter doesn't seem to have assigned the model as a property of the super-object. I know this is turning into a lot of work for a simple tutorial which should work (and in most cases does), but please could you zip up your application (including the system directory and any .htaccess file you might have), upload it to a filesharing Web site, and post the link on here? I'd like to see if I can replicate the problem.
[eluser]andreffonseca[/eluser]
Hi TheFuzzy0ne . This is no a tut i'm doing... i'm trying to dev something. I used to use another version of CI, but i now i return to CI (work demand) and got the last version....and this change I will do what you ask, but the structure is the same as in CI zip. Thanks in Advance.
[eluser]TheFuzzy0ne[/eluser]
Indeed, but the fact that I don't have the same problem, and you do, indicates to me that it's either something not right in your code, or some kind of problem with your server setup. If I can test it out, I should be able to confirm which it is.
[eluser]andreffonseca[/eluser]
This is so ...... if i do this in my model: Code: class Fieldvalidation extends CI_Model{ nothing work...but if i extend from CI_Controller like this... Code: class Fieldvalidation extends CI_Controller{ it work great ... Ugly Solution: if i create like a class that inherited from CI_Controller like Code: class Mysuperclass extends CI_Controller{ and them in my controllers/models i extend from the Mysuperclass Code: class Fieldvalidation extends Mysuperclass{ it's to ugly?
[eluser]andreffonseca[/eluser]
Problem solved: Code: /** it was this in the model class (used for auto suggest in Netbeans) that was messing this up...god But this is only messing in the CI_Model class...got this in the CI_Controller class and everything is ok...strange
[eluser]TheFuzzy0ne[/eluser]
Well done! Glad you got it sorted. Please see here for an alternate method of getting Netbeans code-completion to work, but without declaring any variables. http://ellislab.com/forums/viewthread/187949/
[eluser]andreffonseca[/eluser]
Thanks TheFuzzy0ne, already saw it Thanks for all. |
Welcome Guest, Not a member yet? Register Sign In |