CodeIgniter Forums
function and method with CI controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: function and method with CI controller (/showthread.php?tid=22025)



function and method with CI controller - El Forum - 08-27-2009

[eluser]ranjitbd[/eluser]
what is the difference between function and method with CI controller


function and method with CI controller - El Forum - 08-27-2009

[eluser]jedd[/eluser]
[quote author="ranjitbd" date="1251381015"]what is the difference between function and method with CI controller[/quote]

Within a controller, none.

A function is just a .. well, it's a function. The PHP.net site would describe this much better than I could, and with fewer words I suspect.

A method is what we call a function that exists within a class. (And since a controller is a class ...)

It's kind of like the distinction between an attribute and a variable ... Wink