Currently having problems calling functions from other PHP classes
in the same folder. I have instantiated the class and everything, and it still doesn't work for me.
The error message I get when calling a function from the first class is:
method getHello() not found in class.
Hope anyone know how to fix this issue, believe I have done something wrong somewhere.
Thank you very much in advance, below is the code for both php
files.
<?php
class one
{
private $hello;
public function __construct()
{
$this->hello = '';
}
public function getHello()
{
return $this->hello;
}
public function setHello($newHello)
{
$this->hello = $newHello;
}
}
?>
and the second class
<?php
class two
{
private $sixPack;
public function __contruct()
{
$this->sixPack = new one();
}
public function setSixPack($newSixPack)
{
$this->sixPack = $newSixPack;
}
public function getSixPack()
{
return $this->sixPack;
}
public function access_function_one_methods()
{
// this is causing the problem, cannot access getHello
$sad = $this->sixPack->getHello();
}
}
?>