CodeIgniter Forums
OO newbie - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: OO newbie (/showthread.php?tid=53984)



OO newbie - El Forum - 08-17-2012

[eluser]ptvw2011[/eluser]
Hi -

I think have been using CI to write procedural code in an MVC file system. I wondered if someone could verify if this is the case.

I have never had the need to set class level variables and setters and getters. I have never instantiated an object

$bar = new Foo($construct);

$stuff = $bar->whatever();

I have made a website which basically consists of links to functions. So if I were to run the above function I would just link it by doing something like http://mydomain/foo/whatever.

It would then interact with the model and do whatever I need to do.

Am I missing something here? I understand OO principles but have really never used them properly in PHP MVC.

Am I writing poor code?

Thanks





OO newbie - El Forum - 08-17-2012

[eluser]ptvw2011[/eluser]
Actually I do use classes in this way I just auto load them like $this->order->_getOrderDetail but still I have never used setters and getters!