enhanced get smarty object by instance function
This commit is contained in:
@@ -57,14 +57,18 @@ class Serendipity_Smarty extends Smarty
|
|||||||
* $serendipity['smarty'] = Serendipity_Smarty::getInstance();
|
* $serendipity['smarty'] = Serendipity_Smarty::getInstance();
|
||||||
* The first time this is called a new instance will be created. Thereafter, the same instance is handed back.
|
* 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?
|
// enable smarty object by instance always
|
||||||
public static function getInstance()
|
public static function getInstance($newInstance = null)
|
||||||
{
|
{
|
||||||
static $instance = null;
|
static $instance = null;
|
||||||
if ( $instance == null )
|
if(isset($newInstance)) {
|
||||||
|
$instance = $newInstance;
|
||||||
|
}
|
||||||
|
if ( $instance == null ) {
|
||||||
$instance = new Serendipity_Smarty();
|
$instance = new Serendipity_Smarty();
|
||||||
|
}
|
||||||
return $instance;
|
return $instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user