Exemplo n.º 1
0
 /** This is how you instantiate/retrieve the class */
 static function getInstance($templateDir = null)
 {
     if (self::$instance == null) {
         $class = __CLASS__;
         self::$instance = new $class($templateDir);
     }
     return self::$instance;
 }
Exemplo n.º 2
0
<?php

require_once dirname(dirname(__FILE__)) . '/Homunculus.php';
$hom = Homunculus::getInstance('demo-theme');
$hom->store(array('title' => 'Another Homunculus Page'));
$hom->top();
?>
<p>Another page using the Homunculus class.</p>
<?php 
$hom->retrieveFragment('second');
?>
<p><a href="index.php">Return to first page.</a></p>
<?php 
$hom->bottom();
Exemplo n.º 3
0
<?php

$hom = Homunculus::getInstance();
?>
<footer>
<p><a href="https://github.com/soundgnome/homunculus">github repo</a></p>
</footer>
</div>
<?php 
$hom->htmlInclude('footJS');