Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CakePHP - Fatal error: Call to undefined function

I get the following error:

Fatal error: Call to undefined function getAvnet() in C:\xampp\htdocs\ems\app\controllers\queries_controller.php on line 23

The line is:

$ret = getAvnet('de', $searchstring);

supposedly calling

function getAvnet($country, $query)
like image 315
Dominik Avatar asked Aug 15 '10 17:08

Dominik


1 Answers

You need to use

$ret = $this->getAvnet('de', $searchstring);

In general you need to use $this-> when accessing class methods and variables.

Read: http://php.net/manual/en/language.oop5.basic.php

like image 145
quantumSoup Avatar answered Oct 19 '22 02:10

quantumSoup