I\'ve this controller, and the function read($q)
return error Call to undefined function sendRequest()
Try:
return $this->sendRequest($uri);
Since PHP is not a pure Object-Orieneted language, it interprets sendRequest()
as an attempt to invoke a globally defined function (just like nl2br()
for example), but since your function is part of a class ('InstagramController'), you need to use $this
to point the interpreter in the right direction.
Yes. Problem is in wrong notation. Use:
$this->sendRequest($uri)
Instead. Or
self::staticMethod()
for static methods. Also read this for getting idea of OOP - http://www.php.net/manual/en/language.oop5.basic.php