Stash::_post_parse PHP Метод

_post_parse() приватный Метод

Delay processing a tag until template_post_parse hook
private _post_parse ( $method ) : Mixed
Результат Mixed TRUE if delay, FALSE if not
    private function _post_parse($method)
    {
        // base our needle off the calling tag
        // add a random number to prevent EE caching the tag, if it is used more than once
        $placeholder = md5($this->EE->TMPL->tagproper) . rand();
        if (!isset($this->EE->session->cache['stash']['__template_post_parse__'])) {
            $this->EE->session->cache['stash']['__template_post_parse__'] = array();
        }
        if ($this->process == 'end') {
            // postpone until end of tag processing
            $cache =& $this->EE->session->cache['stash']['__template_post_parse__'];
        } else {
            // unknown or impossible post-process stage
            $this->EE->output->show_user_error('general', sprintf($this->EE->lang->line('unknown_post_process'), $this->EE->TMPL->tagproper, $this->process));
            return;
        }
        $this->EE->TMPL->log_item("Stash: this tag will be post-processed on {$this->process}: {$this->EE->TMPL->tagproper}");
        $cache[$placeholder] = array('method' => $method, 'tagproper' => $this->EE->TMPL->tagproper, 'tagparams' => $this->EE->TMPL->tagparams, 'tagdata' => $this->EE->TMPL->tagdata, 'priority' => $this->priority);
        // return needle so we can find it later
        return LD . $placeholder . RD;
    }