Heb een extensie van een klasse gemaakt en wil wat functies uit de parent-class aanroepen:
Natuurlijk kan het met $this-> wel, maar parent:: leek me netter, maar dan weet PHP niet wat de parent class is:
Fatal error: No parent class available in this context in explorer/SiteStructureExplorerInfo.php on line 6
Komt dit doordat parent:: (of eventueel ComponentInfo::) in feite static functions zijn?
PHP:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
| <? include("DevTools/ComponentInfo.php"); class SiteStructureExplorerInfo extends ComponentInfo { function SiteStructureExplorerInfo() { /* parent::ComponentInfo("SiteStructureExplorer", "247Spark+", "0.2.1", "beta", "SiteStructureExplorer builds a tree showing the structure of a site, as generated by the SiteGenerator. It will allow the user to click on action-icons."); parent::addVersionHistory("0.1", "12-01-2001", "Simple generation of a Windows-Eplorer-like tree"); parent::addVersionHistory("0.2", "15-01-2001", "A testtree shows the real contents of a site"); */ $this->ComponentInfo("SiteStructureExplorer", "247Spark+", "0.2.1", "beta", "SiteStructureExplorer builds a tree showing the structure of a site, as generated by the SiteGenerator. It will allow the user to click on action-icons."); $this->addVersionHistory("0.1", "12-01-2001", "Simple generation of a Windows-Eplorer-like tree"); $this->addVersionHistory("0.2", "15-01-2001", "A testtree shows the real contents of a site"); } } ?> |
Natuurlijk kan het met $this-> wel, maar parent:: leek me netter, maar dan weet PHP niet wat de parent class is:
Fatal error: No parent class available in this context in explorer/SiteStructureExplorerInfo.php on line 6
Komt dit doordat parent:: (of eventueel ComponentInfo::) in feite static functions zijn?