1
0

enhanced get smarty object by instance function

This commit is contained in:
Ian
2011-12-04 17:25:59 +01:00
parent b0377ef865
commit 747f9b207a

View File

@@ -57,14 +57,18 @@ class Serendipity_Smarty extends Smarty
* $serendipity['smarty'] = Serendipity_Smarty::getInstance();
* The first time this is called a new instance will be created. Thereafter, the same instance is handed back.
**/
// ??? what does that mean for us - exactly?
public static function getInstance()
// enable smarty object by instance always
public static function getInstance($newInstance = null)
{
static $instance = null;
if ( $instance == null )
if(isset($newInstance)) {
$instance = $newInstance;
}
if ( $instance == null ) {
$instance = new Serendipity_Smarty();
}
return $instance;
}
}
public function __construct()
{