Stash::_prep_no_results PHP Метод

_prep_no_results() публичный Метод

prep a prefixed no_results block in current template tagdata
public _prep_no_results ( string $prefix ) : String
$prefix string
Результат String
    function _prep_no_results($prefix)
    {
        if (strpos($this->EE->TMPL->tagdata, 'if ' . $prefix . ':no_results') !== FALSE && preg_match("/" . LD . "if " . $prefix . ":no_results" . RD . "(.*?)" . LD . '\\/' . "if" . RD . "/s", $this->EE->TMPL->tagdata, $match)) {
            if (stristr($match[1], LD . 'if')) {
                $match[0] = $this->EE->functions->full_tag($match[0], $block, LD . 'if', LD . '\\/' . "if" . RD);
            }
            $no_results = substr($match[0], strlen(LD . "if " . $prefix . ":no_results" . RD), -strlen(LD . '/' . "if" . RD));
            $no_results_block = $match[0];
            // remove {if prefix:no_results}..{/if} block from template
            $this->EE->TMPL->tagdata = str_replace($no_results_block, '', $this->EE->TMPL->tagdata);
            // set no_result variable in Template class
            $this->EE->TMPL->no_results = $no_results;
        }
    }