diff options
| author | spiderr <spider@viovio.com> | 2012-06-13 00:36:46 -0400 |
|---|---|---|
| committer | spiderr <spider@viovio.com> | 2012-06-13 00:36:46 -0400 |
| commit | b3f35a7f307b55982ba00244959c2a2f0047ea71 (patch) | |
| tree | 6af206ac0766ea34c925aed9c56e7caf3742dae1 | |
| parent | 43a8df993c01344a2ead7e05bf1c3833883f67b4 (diff) | |
| download | kernel-b3f35a7f307b55982ba00244959c2a2f0047ea71.tar.gz kernel-b3f35a7f307b55982ba00244959c2a2f0047ea71.tar.bz2 kernel-b3f35a7f307b55982ba00244959c2a2f0047ea71.zip | |
assign singleton to smarty automatically
| -rw-r--r-- | BitSingleton.php | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/BitSingleton.php b/BitSingleton.php index 100794e..ea19784 100644 --- a/BitSingleton.php +++ b/BitSingleton.php @@ -39,6 +39,9 @@ abstract class BitSingleton extends BitBase { $singleton = static::getSingleInstance(); if (!isset($singleton)) { $singleton = new static; + $globalVar = 'g'.get_class( $singleton ); + global $gBitSmarty; + $gBitSmarty->assign_by_ref( $globalVar, $singleton ); } return $singleton; } |
