示例#1
0
 /**
  * 模板调用函数。在标签打开时调用,用于控制标签内部是否执行。
  *
  * @param int $type 标签类型
  * @param string $uniqid 节点ID
  * @param array $params 标签参数
  * @static
  * @final
  * @access public
  * @return bool 是否需要执行标签内部内容
  * @see compileOpenTag
  * @see PageController::openTag
  */
 public static final function open($type, $uniqid, $params = null)
 {
     assert('self::$state === self::STAT_FIRST || self::$state === self::STAT_LOOP');
     if (self::has($uniqid)) {
         assert('isset(self::$context->children[$uniqid])');
         $context = self::$context->children[$uniqid];
         assert('$context->type === $type');
     } else {
         if (!isset($params)) {
             $params = array();
         }
         if ($type == self::TAG_HTML && isset($params['her'])) {
             BigPipeResource::registModule($params['her']);
             self::$jsLib = $params['her'];
             unset($params['her']);
             if (isset($params['bigrender'])) {
                 self::$bigrenderLib = $params['bigrender'];
                 unset($params['bigrender']);
             }
         }
         if (isset($params['bigrender'])) {
             $bigrender = true;
             unset($params['bigrender']);
         }
         $context = new PageletContext($type, $params);
         $context->parent = self::$context;
         self::$context->children[$uniqid] = $context;
         if (isset($bigrender) && $bigrender) {
             $context->bigrender = true;
         }
     }
     self::$context = $context;
     return $context->opened = self::$controller->openTag($context);
 }