Chciałbym stworzyć klasę:
Kod
<?
class test
{
}
?>
class test
{
}
?>
a potem dodac do niej funkcje, np:
Kod
function pisz()
{
print 'czesc';
}
{
print 'czesc';
}
Można?
<?php class engine { (...) public function getInstance() { if($instance == NULL) { $instance = new engine; } return $instance; } ?>
<?php class template { function costam() { $this->engine=engine::getInstance(); } } ?>
<?php class Engine { if (self::$oInstance == null) { self::$oInstance = new Engine(); } return self::$oInstance; } /* TYLKO DLA CELÓW TESTU */ self::$oInstance = null; } } class Engine_Download extends Engine { if (parent::$oInstance == null) { parent::$oInstance = new Engine_Download(); } return parent::$oInstance; } } Engine::Clear(); Engine_Download::GetInstance(); ?>