加载一个区块模板

@param string $tpl
@param array  $vars 变量
160429
protected function _blockLoad($tpl, array $vars = array()) {
        $vars && \extract($vars);
        include "{$this->_template_dir}/{$tpl}.phtml";

        $this->_display_html .= \ob_get_contents();
        \ob_clean();
    }
88822
public function addBlock($key, Template $tpl = null)
    {
        $this->blocks[ $key ] = $tpl !== null
            ? $tpl->addVar('id_block', "block-$key")
            : null;

        return $this;
    }
276025
protected function setJSONPayload($vars) {
    $this->headers['Content-Type'] = 'application/json';
    $this->headers['Content-Length'] = 0;
    $this->headers['Expect'] = '';

    if (!empty($vars)) {
      $data = json_encode($vars);
      $this->headers['Content-Length'] = strlen($data);
      curl_setopt($this->request, CURLOPT_POSTFIELDS, $data);
    }
  }
1119135
public function setVars($vars)
    {
        $context = $this->_context;

        $context->vars = array_merge($context->vars, $vars);

        return $this;
    }
771748
function assign_vars($vararray)
    {
        reset($vararray);
        while (list($key, $val) = each($vararray)) {
            $this->_tpldata['.'][0][$key] = $val;
        }

        return true;
    }
1295090
function append($tpl_var, $value=null, $merge=false)
	{
		if (is_array($tpl_var)) {
			// $tpl_var is an array, ignore $value
			foreach ($tpl_var as $_key => $_val) {
				if ($_key != '') {
					if(!@is_array($this->_tpl_vars[$_key])) {
						settype($this->_tpl_vars[$_key],'array');
					}
					if($merge && is_array($_val)) {
						foreach($_val as $_mkey => $_mval) {
							$this->_tpl_vars[$_key][$_mkey] = $_mval;
						}
					} else {
						$this->_tpl_vars[$_key][] = $_val;
					}
				}
			}
		} else {
			if ($tpl_var != '' && isset($value)) {
				if(!@is_array($this->_tpl_vars[$tpl_var])) {
					settype($this->_tpl_vars[$tpl_var],'array');
				}
				if($merge && is_array($value)) {
					foreach($value as $_mkey => $_mval) {
						$this->_tpl_vars[$tpl_var][$_mkey] = $_mval;
					}
				} else {
					$this->_tpl_vars[$tpl_var][] = $value;
				}
			}
		}
	}
883592
public function extend($tpl, array $data = [])
    {
        echo $this->render($tpl, array_merge($this->data, $data));
    }
1265221
function renderTmpl (path, vars, callback) {
    fs.readFile(path, 'utf8', function (err, file) {
        if (err) {
            return callback(err);
        }
        var out = file.replace(/\{\{([a-z]+)\}\}/ig, function (all, name) {
            return vars[name];
        });
        callback(null, out);
    });
}
582041
public function render($tpl, array $vars = array(), array $cookies = array())
    {
        Logger::log('Start render response');
        $vars = ResponseHelper::setDebugHeaders($vars);
        $output = $this->dump($tpl, $vars);

        return $this->output($output, 'text/html', $cookies);
    }
506706
protected function loadTpl($tpl)
    {
        $this->tplBase = $this->request->args('tplBase') ? $this->request->args('tplBase') : dirname($tpl);
        $content = file_get_contents($tpl);
        $this->prepareTpl($content);
        return json_decode($content, true);
    }
1243068
protected static function pushStack(&$context, $operation, $vars) {
        list($levels, $spvar, $var) = Expression::analyze($context, $vars[0]);
        $context['stack'][] = $context['currentToken'][Token::POS_INNERTAG];
        $context['stack'][] = Expression::toString($levels, $spvar, $var);
        $context['stack'][] = $operation;
        $context['level']++;
    }
832238
private function setCovertVars(array $vars = [])
    {
        $this->setExt($vars['ext']);
        $this->capsule['ext'] = $vars['ext'];
        $this->setFilePath($vars['filepath']);
        $this->capsule['filepath'] = $vars['filepath'];
    }
1287730
protected function _setTpl($tpl)
    {
        $this->_tpl = $tpl;

        if ($tpl === true) {
            $this->_tpl = self::TPL_WRAP;
        }

        if ($tpl === false) {
            $this->_tpl = self::TPL_DEFAULT;
        }
    }
933709
protected function render($tpl, array $data = [])
	{
		$suffix = $this->app->config('template.suffix');
        $suffix = (empty($suffix)) ? $this->viewSuffix : $suffix;
        $tpl   .= $suffix;

		$this->app->render($tpl, $data);
	}
306848
public function loadVars(array $vars)
    {
        $this->vars = array_merge($this->vars, $vars);

        return (bool)empty($this->vars);
    }
1055569
public function block($path, $vars = [])
    {
        if ($path[0] !== '@' && strpos($path, '/') === false) {
            $path = "@views/Blocks/$path";
        }

        $this->_render($path, $vars, true);
    }
286811
public function load($_filename,$vars=null){
        if(!is_null($vars))
            extract($vars, EXTR_OVERWRITE);
        eval('?>'.$this->read($_filename));
    }