示例#1
0
文件: HTML.php 项目: xiphe/html
 /**
  * Getter for a HTML instance.
  *
  * Returns the first available instance in this order.
  *  - last used instance
  *  - global instance
  *  - new instance
  *  
  * @param array $initArgs if a new instance is created initiation 
  *    args can be passed here
  * 
  * @return Xiphe\HTML
  */
 public static function get($initArgs = array())
 {
     if (get_class(Core\Config::getHTMLInstance()) == 'Xiphe\\HTML') {
         return Core\Config::getHTMLInstance();
     } elseif (get_class($GLOBALS['HTML']) == 'Xiphe\\HTML') {
         return $GLOBALS['HTML'];
     } else {
         return new HTML($initArgs);
     }
 }