You are here

function Smarty_Compiler::_pop_cacheable_state in Quiz 6.6

Same name and namespace in other branches
  1. 6.5 includes/moodle/lib/smarty/Smarty_Compiler.class.php \Smarty_Compiler::_pop_cacheable_state()

check if the compilation changes from non-cacheable to cacheable state with the end of the current plugin return php-code to reflect the transition.

Return value

string

3 calls to Smarty_Compiler::_pop_cacheable_state()
Smarty_Compiler::_compile_block_tag in includes/moodle/lib/smarty/Smarty_Compiler.class.php
compile block function tag
Smarty_Compiler::_compile_compiler_tag in includes/moodle/lib/smarty/Smarty_Compiler.class.php
compile the custom compiler tag
Smarty_Compiler::_compile_custom_tag in includes/moodle/lib/smarty/Smarty_Compiler.class.php
compile custom function tag

File

includes/moodle/lib/smarty/Smarty_Compiler.class.php, line 2222

Class

Smarty_Compiler
Template compiling class @package Smarty

Code

function _pop_cacheable_state($type, $name) {
  $_cacheable = !isset($this->_plugins[$type][$name]) || $this->_plugins[$type][$name][4];
  if ($_cacheable || --$this->_cacheable_state > 0) {
    return '';
  }
  return 'if ($this->caching && !$this->_cache_including) { echo \'{/nocache:' . $this->_cache_serial . '#' . $this->_nocache_count++ . '}\';}';
}