I have the code below. For some reason when I run this code it say the variable rsLinks is undefined. Yet clearly you can see that it is defined in the constructor. Can you tell me what I am doing wrong?
require_once "..\Models\Links.php";
class Navigator
{
public $rsLinks;
public function __construct()
{
$rsLinks = new rsLinks();
}
public function getLinks()
{
$links = $rsLinks;
}
}
$navigator = new Navigator();
$navigator->getLinks();