CakePHP - Fatal error: Call to undefined function
-
28-09-2019 - |
Pergunta
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)
Solução
You need to use
$ret = $this->getAvnet('de', $searchstring);
In general you need to use $this->
when accessing class methods and variables.
Outras dicas
$ret = $this->getAvnet('de', $searchstring);
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow