Exemplo n.º 1
0
 static function load($str_name, $smarty, $async = false)
 {
     if (self::$_context['hit'] || self::$mode == self::$default_mode) {
         FISResource::load($str_name, $smarty, $async);
     }
 }
Exemplo n.º 2
0
/**
 * 渲染页面
 * @param  [type] $id    [description]
 * @param  [type] $array [description]
 * @return [type]        [description]
 */
function display($id, $array)
{
    $path = FISResource::getUri($id);
    if (is_file($path)) {
        extract($array);
        ob_start();
        include $path;
        $html = ob_get_clean();
        FISResource::load($id);
        //注意模板资源也要分析依赖,否则可能加载不全
        echo FISResource::renderResponse($html);
    } else {
        trigger_error($id . ' file not found!');
    }
}
 public function testLoadAsync()
 {
     FISResource::load('common:static/common/index/index.js', new Smarty());
     $this->assertEqualsIgnoreSeparator(FISResource::getResourceMap(), '{"res":{"common:static/common/ui/async/async.js":{"url":"/static/common/ui/async/async.js","deps":[]}}}');
 }