2012-07-04 05:23:08 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Smarty Internal Plugin Compile Nocache
|
|
|
|
* Compiles the {nocache} {/nocache} tags.
|
|
|
|
*
|
2014-09-07 11:38:28 +00:00
|
|
|
* @package Smarty
|
2012-07-04 05:23:08 +00:00
|
|
|
* @subpackage Compiler
|
2014-09-07 11:38:28 +00:00
|
|
|
* @author Uwe Tews
|
2012-07-04 05:23:08 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
2014-09-07 11:38:28 +00:00
|
|
|
* Smarty Internal Plugin Compile Nocache Class
|
2012-07-04 05:23:08 +00:00
|
|
|
*
|
2014-09-07 11:38:28 +00:00
|
|
|
* @package Smarty
|
2012-07-04 05:23:08 +00:00
|
|
|
* @subpackage Compiler
|
|
|
|
*/
|
2014-09-07 11:38:28 +00:00
|
|
|
class Smarty_Internal_Compile_Nocache extends Smarty_Internal_CompileBase
|
|
|
|
{
|
2012-07-04 05:23:08 +00:00
|
|
|
/**
|
|
|
|
* Compiles code for the {nocache} tag
|
|
|
|
* This tag does not generate compiled output. It only sets a compiler flag.
|
|
|
|
*
|
2014-09-07 11:38:28 +00:00
|
|
|
* @param array $args array with attributes from parser
|
|
|
|
* @param object $compiler compiler object
|
|
|
|
*
|
2012-07-04 05:23:08 +00:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function compile($args, $compiler)
|
|
|
|
{
|
|
|
|
$_attr = $this->getAttributes($compiler, $args);
|
|
|
|
if ($_attr['nocache'] === true) {
|
|
|
|
$compiler->trigger_template_error('nocache option not allowed', $compiler->lex->taglineno);
|
|
|
|
}
|
|
|
|
// enter nocache mode
|
|
|
|
$compiler->nocache = true;
|
|
|
|
// this tag does not return compiled code
|
|
|
|
$compiler->has_code = false;
|
2014-09-07 11:38:28 +00:00
|
|
|
|
2012-07-04 05:23:08 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Smarty Internal Plugin Compile Nocacheclose Class
|
|
|
|
*
|
2014-09-07 11:38:28 +00:00
|
|
|
* @package Smarty
|
2012-07-04 05:23:08 +00:00
|
|
|
* @subpackage Compiler
|
|
|
|
*/
|
2014-09-07 11:38:28 +00:00
|
|
|
class Smarty_Internal_Compile_Nocacheclose extends Smarty_Internal_CompileBase
|
|
|
|
{
|
2012-07-04 05:23:08 +00:00
|
|
|
/**
|
|
|
|
* Compiles code for the {/nocache} tag
|
|
|
|
* This tag does not generate compiled output. It only sets a compiler flag.
|
|
|
|
*
|
2014-09-07 11:38:28 +00:00
|
|
|
* @param array $args array with attributes from parser
|
|
|
|
* @param object $compiler compiler object
|
|
|
|
*
|
2012-07-04 05:23:08 +00:00
|
|
|
* @return bool
|
|
|
|
*/
|
|
|
|
public function compile($args, $compiler)
|
|
|
|
{
|
|
|
|
$_attr = $this->getAttributes($compiler, $args);
|
|
|
|
// leave nocache mode
|
|
|
|
$compiler->nocache = false;
|
|
|
|
// this tag does not return compiled code
|
|
|
|
$compiler->has_code = false;
|
2014-09-07 11:38:28 +00:00
|
|
|
|
2012-07-04 05:23:08 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|