Fatal error: Using $this when not in object context
Posted: Thu Nov 26, 2009 8:43 am
Hey everyone - again,
I'm having an issue with $this. I'm using it just how tutorials say we should use it and it's not accepting it. Any help?
Fatal error: Using $this when not in object context in C:\rk\includes\class.html.php on line 26
I'm having an issue with $this. I'm using it just how tutorials say we should use it and it's not accepting it. Any help?
Fatal error: Using $this when not in object context in C:\rk\includes\class.html.php on line 26
Code: Select all
<?php
####################
# RouteKanal, Ltd. #
####################
require_once('core.php');
class HTMLFactory {
var $basic_content;
var $create_content;
private function createBasic($content) {
$this->basic_content = $content;
return $this->basic_content;
}
public function createPage($content) {
$this->create_content = $content;
echo(HTMLFactory::createBasic($this->create_content));
}
}
HTMLFactory::createPage('test');
?>