Template::getCacheLifetime PHP 메소드

getCacheLifetime() 공개 메소드

public getCacheLifetime ( ) : integer
리턴 integer
    public function getCacheLifetime()
    {
        return $this->m_data['CacheLifetime'];
    }

Usage Example

예제 #1
0
/**
 * Campsite render function plugin
 *
 * Type:     function
 * Name:     render
 * Purpose:  template rendering
 *
 * @param array
 *     $p_params
 * @param object
 *     $p_smarty The Smarty object
 *
 * @return
 *     rendered content
 */
function smarty_function_render($p_params, &$p_smarty)
{
    if (empty($p_params['file'])) {
        return null;
    }
    $smarty = CampTemplate::singleton();
    $cache_lifetimeBak = $smarty->cache_lifetime;
    $campsiteVectorBak = $smarty->campsiteVector;
    if (SystemPref::Get('TemplateCacheHandler')) {
        $campsiteVector = $smarty->campsiteVector;
        foreach ($campsiteVector as $key => $value) {
            if (isset($p_params[$key])) {
                if (empty($p_params[$key]) || strtolower($p_params[$key]) == 'off') {
                    $campsiteVector[$key] = null;
                }
                if (is_int($p_params[$key])) {
                    $campsiteVector[$key] = $p_params[$key];
                }
            }
        }
        if (isset($p_params['params'])) {
            $campsiteVector['params'] = $p_params['params'];
        }
        $smarty->campsiteVector = $campsiteVector;
        if (empty($p_params['cache'])) {
            $template = new Template(CampSite::GetURIInstance()->getThemePath() . $p_params['file']);
            $smarty->cache_lifetime = (int) $template->getCacheLifetime();
        } else {
            $smarty->cache_lifetime = (int) $p_params['cache'];
        }
    }
    $smarty->display($p_params['file']);
    $smarty->cache_lifetime = $cache_lifetimeBak;
    $smarty->campsiteVector = $campsiteVectorBak;
}
All Usage Examples Of Template::getCacheLifetime