Files
smarty/libs/sysplugins/smarty_internal_compile_nocache.php

76 lines
2.1 KiB
PHP
Raw Normal View History

<?php
/**
2010-08-17 15:39:51 +00:00
* Smarty Internal Plugin Compile Nocache
2011-09-16 14:19:56 +00:00
* Compiles the {nocache} {/nocache} tags.
*
* @package Smarty
2010-08-17 15:39:51 +00:00
* @subpackage Compiler
* @author Uwe Tews
2010-08-17 15:39:51 +00:00
*/
/**
* Smarty Internal Plugin Compile Nocache Class
2011-09-16 14:19:56 +00:00
*
* @package Smarty
2011-09-16 14:19:56 +00:00
* @subpackage Compiler
*/
class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase
{
/**
* Array of names of valid option flags
*
* @var array
*/
public $option_flags = array();
/**
2010-08-17 15:39:51 +00:00
* Compiles code for the {nocache} tag
2011-09-16 14:19:56 +00:00
* This tag does not generate compiled output. It only sets a compiler flag.
*
* @param array $args array with attributes from parser
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
*
2011-09-16 14:19:56 +00:00
* @return bool
2010-08-17 15:39:51 +00:00
*/
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
{
2011-09-16 14:19:56 +00:00
$_attr = $this->getAttributes($compiler, $args);
$this->openTag($compiler, 'nocache', array($compiler->nocache));
// enter nocache mode
2011-09-16 14:19:56 +00:00
$compiler->nocache = true;
// this tag does not return compiled code
2011-09-16 14:19:56 +00:00
$compiler->has_code = false;
return true;
2011-09-16 14:19:56 +00:00
}
}
/**
2010-08-17 15:39:51 +00:00
* Smarty Internal Plugin Compile Nocacheclose Class
2011-09-16 14:19:56 +00:00
*
* @package Smarty
2011-09-16 14:19:56 +00:00
* @subpackage Compiler
*/
class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase
{
/**
2010-08-17 15:39:51 +00:00
* Compiles code for the {/nocache} tag
2011-09-16 14:19:56 +00:00
* This tag does not generate compiled output. It only sets a compiler flag.
*
* @param array $args array with attributes from parser
* @param \Smarty_Internal_TemplateCompilerBase $compiler compiler object
*
2011-09-16 14:19:56 +00:00
* @return bool
2010-08-17 15:39:51 +00:00
*/
public function compile($args, Smarty_Internal_TemplateCompilerBase $compiler)
{
2011-09-16 14:19:56 +00:00
$_attr = $this->getAttributes($compiler, $args);
// leave nocache mode
list($compiler->nocache) = $this->closeTag($compiler, array('nocache'));
// this tag does not return compiled code
2011-09-16 14:19:56 +00:00
$compiler->has_code = false;
return true;
2011-09-16 14:19:56 +00:00
}
}