runFilter example

// loop over items, stitch back together                 foreach ($cache_split as $curr_idx => $curr_split) {
                    // escape PHP tags in template content                     $output .= preg_replace('/(<%|%>|<\?php|<\?|\?>)/', '<?php echo \'$1\'; ?>', $curr_split);
                    if (isset($cache_parts[0][$curr_idx])) {
                        $_template->properties['has_nocache_code'] = true;
                        // remove nocache tags from cache output                         $output .= preg_replace("!/\*/?%%SmartyNocache:{$_template->properties['nocache_hash']}%%\*/!", '', $cache_parts[0][$curr_idx]);
                    }
                }
                if (!$no_output_filter && !$_template->has_nocache_code && (isset($this->smarty->autoload_filters['output']) || isset($this->smarty->registered_filters['output']))) {
                    $output = Smarty_Internal_Filter_Handler::runFilter('output', $output$_template);
                }
                // rendering (must be done before writing cache file because of {function} nocache handling)                 $_smarty_tpl = $_template;
                try {
                    ob_start();
                    eval("?>" . $output);
                    $_output = ob_get_clean();
                } catch (Exception $e) {
                    ob_get_clean();
                    throw $e;
                }
                
$template_header .= '<?php /* Smarty version ' . Smarty::SMARTY_VERSION . ', created on ' . date('Y-m-d H:i:s') . "\n";
            $template_header .= ' compiled from "' . $this->template->source->filepath . "\" */ ?>\n";
        }

        do {
            // flag for aborting current and start recompile             $this->abort_and_recompile = false;
            // get template source             $_content = $template->source->content;
            // run prefilter if required             if (isset($this->smarty->autoload_filters['pre']) || isset($this->smarty->registered_filters['pre'])) {
                $_content = Smarty_Internal_Filter_Handler::runFilter('pre', $_content$template);
            }
            // on empty template just return header             if ($_content == '') {
                if ($this->suppressTemplatePropertyHeader) {
                    $code = '';
                } else {
                    $code = $template_header . $template->createTemplateCodeFrame();
                }
                return $code;
            }
            // call compiler
Home | Imprint | This part of the site doesn't use cookies.