I’m new to OOP and I can’t figure out why this isn’t working. Is it not ok to instantiate a class with in a class. I’ve tried this with included file with in the method and it didn’t make a change.
include('Activate.php');
class First {
function __construct() {
$this->activate();
}
private function activate() {
$go = new Activate('Approved');
}
}
$run = new First();
Okay I figured out my issue. My code had two errors. One that being my method was set to private and secondly I had an error in my
$parmsthat I was sending to the class.