MetaModels\FrontendIntegration\FrontendFilter::generateClearAll PHP Method

generateClearAll() public method

This is called via parseTemplate HOOK to inject the "clear all" filter into fe_page.
public generateClearAll ( string $strContent, string $strTemplate ) : string
$strContent string The whole page content.
$strTemplate string The name of the template being parsed.
return string
    public function generateClearAll($strContent, $strTemplate)
    {
        if (substr($strTemplate, 0, 7) === 'fe_page') {
            if (preg_match_all('#\\[\\[\\[metamodelfrontendfilterclearall::(ce|mod)::([^\\]]*)\\]\\]\\]#', $strContent, $arrMatches, PREG_SET_ORDER)) {
                foreach ($arrMatches as $arrMatch) {
                    switch ($arrMatch[1]) {
                        case 'ce':
                            $strContent = $this->generateContentElement($strContent, $arrMatch[0], $arrMatch[2]);
                            break;
                        case 'mod':
                            $strContent = $this->generateModule($strContent, $arrMatch[0], $arrMatch[2]);
                            break;
                        default:
                            throw new \RuntimeException('Unexpected element determinator encountered: ' . $arrMatch[1]);
                    }
                }
            }
        }
        return $strContent;
    }