I started using OOP in PHP for first time, and I dont know how to achieve the following structure for my variables:
$this->myData->generalData->title; $this->myData->generalData->description; $this->myData->amount; $this->myData->addNewData(); Up till now, what I am achieving is a normal variable inside a class:
$this->variablename I tried doing this code, but it's not working at all:
$this->CDNE = "CDNE"; $this->CDNE->FOLDER = "hello man"; Can you explain me, how all this works?
$this->myDatacould be an object of another class holding the propertiesgeneralDataandamount, also methods can be implemented in that object, ...$var = $object. Or directly by instantiation:$var = new myClass. This obviously is also possible inside an object, for example inside the class constructor:$this->var = new myClass;.$this->cdne['content'] = "CDNE"; $this->cdne['folder'] = "hello man";