PHP Classes

File: lib/internal/template.fetch_compile_include.php

Recommend this page to a friend!
  Classes of David Tamas   g-template-php   lib/internal/template.fetch_compile_include.php   Download  
File: lib/internal/template.fetch_compile_include.php
Role: Example script
Content type: text/plain
Description: Example script
Class: g-template-php
Process and render templates generating PHP code
Author: By
Last change:
Date: 5 years ago
Size: 1,164 bytes
 

Contents

Class file image Download
<?php
/**
 * gTemplate Internal Function
 * Include a subtemplate
 *
 * @package gTemplate
 * @subpackage internalFunctions
 */

function template_fetch_compile_include($include_file, $include_vars, &$gTpl) {
    if (
$gTpl->debug) {
       
$gTpl->_debug_info[] = array('type' => 'template',
           
'filename' => $include_file,
           
'depth' => ++$gTpl->_inclusion_depth,
           
'exec_time' => array_sum(explode(' ', microtime())));
       
$included_tpls_idx = count($gTpl->_debug_info) - 1;
    }

   
$gTpl->_vars = array_merge($gTpl->_vars, $include_vars);
   
$include_file = $gTpl->_get_resource($include_file);
    if (isset(
$gTpl->_confs[0])) {
       
array_unshift($gTpl->_confs, $gTpl->_confs[0]);
       
$_compiled_output = $gTpl->_fetch_compile($include_file);
       
array_shift($gTpl->_confs);
    } else {
       
$_compiled_output = $gTpl->_fetch_compile($include_file);
    }

   
$gTpl->_inclusion_depth--;

    if (
$gTpl->debug) {
       
$gTpl->_debug_info[$included_tpls_idx]['exec_time'] = array_sum(explode(' ', microtime())) - $gTpl->_debug_info[$included_tpls_idx]['exec_time'];
    }
    return
$_compiled_output;
}